A Tiny Introduction to JavaScript with Exercises and Puzzles
- Length: 149 pages
- Edition: 1
- Language: English
- Publisher: ProseTech
- Publication Date: 2020-11-24
- ISBN-10: 1775373762
- ISBN-13: 9781775373766
- Sales Rank: #4767526 (See Top 100 Books)
Real coding for complete beginners.
Join Matthew MacDonald, author of too-many-tech-books-to-count, as he enters the world of JavaScript—accompanied by friendly ninjas, cheating goblins, and at least one rude wizard.
Develop your skills with 35 interactive exercises on CodePen. Best of all, there’s no setup required (a web browser is all you need).
Who needs another book about coding for kids?
These days, you can’t turn around twice without someone trying to teach you how to code. So why the heck did I write my own book?
When my daughters started learning to code, I discovered that most tutorials were as dry as dust. If you wanted something more fun, you could play a coding game and write commands to move a character around a maze. But unlike real programming, there was no chance to be creative. There was no freedom. There was no invitation to build your own programs.
Here’s what makes this book different:
- Hands-on practice. If you want to learn a new skill, you need to practice. Otherwise, it’s just a bunch of theory swimming around in your head.
- Friendly for beginners. If you’re a beginner, it’s not enough to learn the basics of a programming language like JavaScript. You also need to learn the concepts of programming at the same time.
- No setup required. The world is full of amazing frameworks, tools, and code editors. But who wants to install a bunch of software before you even get started?
- Tiny. I’m a programming nerd, so I like talking about things like Big O notation. But no one needs to be buried in theory at the start of their journey. In this book, every chapter is a bite-sized lesson that you can usually finish in one sitting.
- Kinda fun. Not everyone has the motivation to learn from an old-fashioned textbook. But who doesn’t want to play dice with a cheating goblin?
So I decided to make something of my own. Then I unleashed it on my family.
This is the result of those experiments.
Why JavaScript?
JavaScript is a great first language for people learning to code. It’s not because JavaScript is a great teaching language (it mostly isn’t). It’s because JavaScript is everywhere—on every operating system, every browser, and almost every electronic device that’s more complicated than a toaster.
That means you can effortlessly share your JavaScript programs with friends. Unlike all the rest of computing history, there’s no downloading, installing, or configuring. And it doesn’t hurt that JavaScript syntax is similar to many other professional languages, like Java and C#. That means the effort you spend to learn JavaScript is never wasted.
Can adults read this book?
Most certainly!
However, this book assumes you’re learning JavaScript and programming for the first time. If you already know a bit about programming, you’ll probably prefer a guide that focuses on the JavaScript language without re-introducing the concepts you already know.
Contents Welcome What you need to use this guide Why JavaScript? Why CodePen? What if I’m actually an adult? About me How can I support the Tiny Introductions project? Chapter Zero CodePen: Your New Home Signing up on CodePen Looking at an example on CodePen Hiding the CSS Seeing a bigger preview Forking an example Turning on autocomplete What comes after CodePen Chapter 1 What JavaScript Looks Like Statements Comments Blocks and functions Try it yourself! Hello, Wizard? (Challenge Level: Easy) Optional Really big comments Chapter 2 How Events Work A really quick HTML review How events work Try it yourself! The Staggering Page of Heartbreaking Events (Challenge Level: Easy) Try it yourself! The Broken Button (Challenge Level: Easy) Chapter 3 Storing Information in Variables Declaring a variable Putting a value in a variable Using numbers and text Try it yourself! Predict the Future (Challenge Level: Easy) Optional Putting quotation marks in a string Good variable names Try it yourself! Hello, Ninja! (Challenge Level: Easy) Variables that don’t exist Try it yourself! Find the Impostor (Challenge Level: Medium) Optional Using TypeScript error checking Copying variables Try it yourself! The Gift Swapper (Challenge Level: Tricky) Chapter 4 Changing Variables Really easy math Slightly fancier math Try it yourself! Pocket Calculator (Challenge Level: Easy) Calculations with variables Try it yourself! Pocket Calculator II (Challenge Level: Medium) Calculations can go anywhere Really easy “math” with text Adding numbers and text together Try it yourself! Alice the Unshakeable (Challenge Level: Tricky) Optional Variables that never change Chapter 5 Interacting with the Page Introducing the DOM Getting information out of a text box Try it yourself! A Greeting from the King (Challenge Level: Medium) Converting strings to numbers Try it yourself! Broken Adder (Challenge Level: Easy) Showing a message in the page Try it yourself! A Greeting from the King Rebooted (Challenge Level: Medium) Optional Changing a picture Chapter 6 The Lifetime of a Variable Local variables Global variables Sharing the same variable with different functions Try it yourself! The Friendly Angry Ogre (Challenge Level: Medium) Try it yourself! The Broken Jellybean Counter (Challenge Level: Medium) The secret of the braces Wise advice about global variables Chapter 7 Making Decisions Introducing conditions The if statement More logical operators Try it yourself! The Bowl of Beans (Challenge Level: Medium) The else block Try it yourself! The Bowl of Beans Improved (Challenge Level: Easy) Conditional logic with unlimited possibilities Try it yourself! Predict the Future (Challenge Level: Easy) Try it yourself! Beans Ain’t Free (Challenge Level: Hard) Chapter 8 More Decision Making Combining two conditions (using ‘and’) Combining two conditions (using ‘or’) Try it yourself! Predict the Future (Challenge Level: Medium) The switch statement Try it yourself! The Goblin Dice Gambler (Challenge Level: Medium) Chapter 9 Repeating Yourself with Loops The simplest possible loop A loop that counts Try it yourself! Predict the Future (Challenge Level: Easy) Try it yourself! Put It In Reverse (Challenge Level: Medium) Putting the condition at the end A loop without a counter Try it yourself! Million Dollar Pizza (Challenge Level: Medium) Try it yourself! Million Dollar Pizza II (Challenge Level: Hard) Optional For, a loop with a built-in counter Chapter 10 Organizing with Functions Adding new functions Calling a function Try it yourself! Follow the Function Trail (Challenge Level: Easy) Functions that get data Using multiple parameters Try it yourself! Alien Language Translator (Challenge Level: Medium) Chapter 11 Functions that Answer Questions Functions that give answers Try it yourself! Predict the Future (Challenge Level: Easy) Try it yourself! Alien Language Translator II (Challenge Level: Hard) Chapter 12 Getting More Serious with Math Math shortcuts Try it yourself! Predict the Future (Challenge Level: Easy) The wacky mistake JavaScript makes with decimals Try it yourself! The Broken Dime Adder (Challenge Level: Medium) Peeking into the Math object Try it yourself! How Big Is this Cake? (Challenge Level: Medium) Rounding numbers Try it yourself! How Big Is this Cake? (Challenge Level: Easy) Chapter 13 The Magic of Random Numbers Random and pseudo-random Generating random numbers Try it yourself! ( Number Guesser of Doom (Challenge Level: Medium) Try it yourself! Ice, Dagger, Lava (Challenge Level: Tricky) What Comes Next
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.