JavaScript For Kids For Dummies book cover

JavaScript For Kids For Dummies

Authors:
Chris Minnick ,
Eva Holland
Published: August 24, 2015

Overview

Have big dreams? Kick start them with JavaScript!

If we've learned one thing from the Millennial generation, it's that no one is too young to make history online. JavaScript For Kids For Dummies introduces pre-teens and early teens alike to the world of JavaScript, which is an integral programming language that drives the functionality of websites and apps. This informative, yet engaging text guides you through the basics of coding with JavaScript, and is an essential resource if you want to expand your technology skills while following easy, step-by-step instructions. Through small, goal-oriented projects, you learn key coding concepts, while actually creating apps, games, and more. This hands-on experience, coupled with the presentation of ideas in a simple style, allows you to both learn and retain JavaScript fundamentals.

JavaScript has been heralded as 'the programming language of the web,' and many kids are interested in learning how to use it; however, most schools don't offer coding classes at this level, and most families can't afford the high cost of coding classes through a summer camp. But this can't stop you from developing your JavaScript coding skills! This fun text is all you need to get started on your JavaScript journey.

  • Explore the basics of JavaScript through the creation of a calculator app
  • Deepen your understanding of HTML, arrays, and variables by building a grocery shopping app
  • Learn conditional logic through the development of a choose your own adventure game
  • Discover loops and strings by creating a lemonade stand app and MadLibs-style game

JavaScript For Kids For Dummies brings pre-teens and early teens into the world of coding by teaching them one of the key Web design languages.

Have big dreams? Kick start them with JavaScript!

If we've learned one thing from the Millennial generation, it's that no one is too young to make history online. JavaScript For Kids For Dummies introduces pre-teens and early teens alike to the world of JavaScript, which is an integral programming language that drives the functionality of websites and apps. This informative, yet engaging text guides you through the basics of coding with JavaScript, and is an essential resource if you want to expand your technology skills while following easy, step-by-step instructions. Through small, goal-oriented projects, you learn key coding concepts, while actually creating apps, games, and more. This hands-on experience, coupled with the presentation of ideas in a simple style, allows you to both learn and retain JavaScript fundamentals.

JavaScript has been heralded as 'the programming language

of the web,' and many kids are interested in learning how to use it; however, most schools don't offer coding classes at this level, and most families can't afford the high cost of coding classes through a summer camp. But this can't stop you from developing your JavaScript coding skills! This fun text is all you need to get started on your JavaScript journey.

  • Explore the basics of JavaScript through the creation of a calculator app
  • Deepen your understanding of HTML, arrays, and variables by building a grocery shopping app
  • Learn conditional logic through the development of a choose your own adventure game
  • Discover loops and strings by creating a lemonade stand app and MadLibs-style game

JavaScript For Kids For Dummies brings pre-teens and early teens into the world of coding by teaching them one of the key Web design languages.

JavaScript For Kids For Dummies Cheat Sheet

When you’re programming in JavaScript, you need to know how to convert CSS property names to JavaScript. An important part of JavaScript’s ability to perform useful functions in the browser is its ability to respond to events, including those listed here. Finally, some words cannot be used as JavaScript variables, functions, methods, loop labels, or object names; those reserved words are listed here.

Articles From The Book

42 results

JavaScript Articles

What Are JavaScript Reserved Words?

JavaScript has some reserved words you should know before you begin coding. The following table contains a list of JavaScript reserved words, which cannot be used as JavaScript variables, functions, methods, loop labels, or object names.

JavaScript Articles

Naming JavaScript Variables

A variable name should accurately identify your variable. When you create good variable names, your JavaScript code becomes easier to understand and easier to work with. Properly naming variables is really important! Here are rules JavaScript has for naming variables:

You’ll be faced with many decisions when choosing how to name your variables: Do you want to begin your variable names with an uppercase letter or a lowercase letter, or do you want to use camelCase? Do you want to use multiple words within your variable names? Do you want to use an underscore (_) between the words in your variable name? (Remember: Variables can’t contain spaces.)

Fortunately, you don’t have to make all these choices by yourself. Many professional programmers agree that there are best practices to keep in mind when naming your variables:

  • Don’t use names that are too short. Simple one-letter names or names that don’t make sense are not a good option when naming variables.

  • Use more than one word to name your variable. This will ensure your variable name is precise.

  • When using more than one word in your variable names, always put the adjective to the left. For example, this is correct: var greenGrass.

  • Pick a style for names with more than one word, and stick to it. The two most common ways to join words to create a name are camelCase and using an underscore (_). JavaScript is flexible — either method works.

No matter what naming format you choose, remembering and using the best practices and being consistent in your naming format will make your code better organized and help you on your way to becoming a professional JavaScript programmer.

JavaScript Articles

Troubleshooting Tips for JavaScript

All JavaScript programmers — beginners and experts alike — have times when they write a program that seems like it should work, but it just doesn’t. Computers will always run programs that are coded correctly, so how do you find the error in your code? Where do you start looking and how do you track it down? Here are some tips for the first things you should look for when a JavaScript program just won’t run.

Check the console

The JavaScript Console in Google’s Chrome browser will tell you if there’s an error, even if it doesn’t always tell you exactly what the error is.

To open the JavaScript Console, select More Tools → JavaScript Console from the Chrome menu.

If you see an error in the console after running your program, it will often include a line number and a link. Click this link to open the spot in the JavaScript where Chrome thinks things went wrong in your program.

If you don’t spot the error immediately (which often is the case), move on to the next tip.

Look for misspellings

JavaScript is picky. Capitalization in variable names as well as in JavaScript keywords makes all the difference. Some JavaScript function names, such as getElementById, are notorious causes of errors as a result of programmers capitalizing them wrong.

Look carefully at each variable name and function name. A code editor that includes JavaScript code hints and code coloring can be a very valuable tool when looking for misspelled words. Some code editors will apply a special color to function names that are spelled correctly, while coloring misspelled names differently.

Check your brackets

Mismatched brackets or parentheses are a common cause of errors. Check to make sure that every parentheses, square bracket, or curly bracket that you open ({) has a matching closing bracket (}).

Match up your quotes

JavaScript will recognize both single and double quotes as holders for strings. But if you start a string with a single quote, it needs to end with a single quote. The same goes for double quotes.

Use console.log()

The console.log() function is a useful tool for figuring out where a program goes wrong. Insert console.log() statements throughout your code while debugging to print out the values of important variables. For example, if you have a loop in your program, you can make sure that the loop is running correctly by putting a console.log() statement inside it like this:

for (var i = 0; i < 10; i ++) {
 console.log(“the value of i is: “ + i);
}

This statement won’t change what happens in the browser window, but if you look in the JavaScript console, you’ll see log entries, indicating that the loop is functioning properly.

Take a break

Sometimes, the best way to debug a program is to walk away from it and take a break. Get a glass of water, take a nap, read a book, or do anything but stare at the program and pull out your hair. When you return to the program, you’ll be refreshed! And the answer to the problem may appear obvious to you!