Synopses & Reviews
JavaScript is the programming language of the Internet, the secret sauce that makes the Web awesome, your favorite sites interactive, and online games fun!
JavaScript for Kids is a lighthearted introduction that teaches programming essentials through patient, step-by-step examples paired with funny illustrations. You'll begin with the basics, like working with strings, arrays, and loops, and then move on to more advanced topics, like building interactivity with jQuery and drawing graphics with Canvas.
Along the way, you'll write games such as Find the Buried Treasure, Hangman, and Snake. You'll also learn how to:
- Create functions to organize and reuse your code
- Write and modify HTML to create dynamic web pages
- Use the DOM and jQuery to make your web pages react to user input
- Use the Canvas element to draw and animate graphics
- Program real user-controlled games with collision detection and score keeping
With visual examples like bouncing balls, animated bees, and racing cars, you can really see what you're programming. Each chapter builds on the last, and programming challenges at the end of each chapter will stretch your brain and inspire your own amazing programs. Make something cool with JavaScript today!
Ages 10+ (and their parents!)
Synopsis
JavaScript for Kids is a lighthearted introduction to the JavaScript language and programming in general. With the help of kid-friendly examples, author Nick Morgan teaches the essentials of JavaScript. Morgan starts with the basics of strings, arrays, and loops, then moves on to show readers how to modify elements with jQuery and draw graphics with canvas. By the end of the book, you'll be ready to create your own fun animations and games and you'll have a solid understanding of the fundamentals of JavaScript.
Synopsis
JavaScript for Kids is a lighthearted introduction to the JavaScript programming language and programming in general. With the help of kid-friendly examples and fun illustrations, author Nick Morgan teaches the essentials of JavaScript. You'll begin by learning the basics, including strings, arrays, and loops, before moving on to more advanced techniques like handling events with jQuery and drawing graphics with canvas. Along the way, you'll program fun games like Hangman, Snake, and "Find the Buried Treasure!"
You'll learn key programming concepts, including:
- Using basic data types and structures, including numbers, strings, booleans, objects, and arrays
- Controlling how your code runs with if statements and loops
- Creating functions to bundle and reuse your code
- Making dynamic and interactive web pages with jQuery
- Using the canvas element to draw and modify graphics with JavaScript
By the end of the book, you'll be ready to create your own animations and games, and you'll have a solid understanding of the fundamentals of JavaScript.
About the Author
Nick Morgan is a senior front-end engineer at Twitter. He lives in San Francisco with his fluffy dog, Pancake. He blogs about JavaScript at skilldrick.co.uk.
Table of Contents
; About the Author; About the Illustrator; About the Technical Reviewer; Acknowledgments; Introduction; Who Should Read This Book?; How to Read This Book; What's in this Book?; Have Fun!; Fundamentals; Chapter 1: What Is JavaScript?; 1.1 Meet JavaScript; 1.2 Why Learn JavaScript?; 1.3 Writing Some JavaScript; 1.4 The Structure of a JavaScript Program; 1.5 What You Learned; Chapter 2: Data Types and Variables; 2.1 Numbers and Operators; 2.2 Variables; 2.3 Strings; 2.4 Booleans; 2.5 undefined and null; 2.6 What You Learned; Chapter 3: Arrays; 3.1 Why Should You Care About Arrays?; 3.2 Creating an Array; 3.3 Accessing an Array's Elements; 3.4 Setting or Changing Elements in an Array; 3.5 Mixing Data Types in an Array; 3.6 Working with Arrays; 3.7 Useful Things to Do with Arrays; 3.8 What You Learned; 3.9 Programming Challenges; Chapter 4: Objects; 4.1 Creating Objects; 4.2 Accessing Values in Objects; 4.3 Adding Values to Objects; 4.4 Combining Arrays and Objects; 4.5 Exploring Objects in the Console; 4.6 Useful Things to Do with Objects; 4.7 What You Learned; 4.8 Programming Challenges; Chapter 5: The Basics of HTML; 5.1 Text Editors; 5.2 Our First HTML Document; 5.3 Tags and Elements; 5.4 A Full HTML Document; 5.5 HTML Hierarchy; 5.6 Adding Links to Your HTML; 5.7 What You Learned; Chapter 6: Conditionals and Loops; 6.1 Embedding JavaScript in HTML; 6.2 Conditionals; 6.3 Loops; 6.4 What You Learned; 6.5 Programming Challenges; Chapter 7: Creating a Hangman Game; 7.1 Interacting with a Player; 7.2 Designing Your Game; 7.3 Coding the Game; 7.4 The Game Code; 7.5 What You Learned; 7.6 Programming Challenges; Chapter 8: Functions; 8.1 The Basic Anatomy of a Function; 8.2 Creating a Simple Function; 8.3 Calling a Function; 8.4 Passing Arguments into Functions; 8.5 Returning Values from Functions; 8.6 Using Function Calls as Values; 8.7 Using Functions to Simplify Code; 8.8 Leaving a Function Early with return; 8.9 Using return Multiple Times Instead of if...else Statements; 8.10 What You Learned; 8.11 Programming Challenges; Advanced JavaScript; Chapter 9: The DOM and jQuery; 9.1 Selecting DOM Elements; 9.2 Using jQuery to Work with the DOM Tree; 9.3 Creating New Elements with jQuery; 9.4 Animating Elements with jQuery; 9.5 Chaining jQuery Animations; 9.6 What You Learned; 9.7 Programming Challenges; Chapter 10: Interactive Programming; 10.1 Delaying Code with setTimeout; 10.2 Canceling a Timeout; 10.3 Calling Code Multiple Times with setInterval; 10.4 Animating Elements with setInterval; 10.5 Responding to User Actions; 10.6 What You Learned; 10.7 Programming Challenges; Chapter 11: Find the Buried Treasure!; 11.1 Designing the Game; 11.2 Creating the Web Page with HTML; 11.3 Picking a Random Treasure Location; 11.4 The Click Handler; 11.5 Putting It All Together; 11.6 What You Learned; 11.7 Programming Challenges; Chapter 12: Object-Oriented Programming; 12.1 A Simple Object; 12.2 Adding Methods to Objects; 12.3 Creating Objects Using Constructors; 12.4 Drawing the Cars; 12.5 Testing the drawCar Function; 12.6 Customizing Objects with Prototypes; 12.7 What You Learned; 12.8 Programming Challenges; Canvas; Chapter 13: The Canvas Element; 13.1 Creating a Basic Canvas; 13.2 Drawing on the Canvas; 13.3 Changing the Drawing Color; 13.4 Drawing Rectangle Outlines; 13.5 Drawing Lines or Paths; 13.6 Filling Paths; 13.7 Drawing Arcs and Circles; 13.8 Drawing Lots of Circles with a Function; 13.9 What You Learned; 13.10 Programming Challenges; Chapter 14: Making Things Move on the Canvas; 14.1 Moving Across the Page; 14.2 Animating the Size of a Square; 14.3 A Random Bee; 14.4 Bouncing a Ball!; 14.5 What You Learned; 14.6 Programming Challenges; Chapter 15: Controlling Animations with the Keyboard; 15.1 Keyboard Events; 15.2 Moving a Ball with the Keyboard; 15.3 Putting It All Together; 15.4 Running the Code; 15.5 What You Learned; 15.6 Programming Challenges; Chapter 16: Making a Snake Game: Part 1; 16.1 The Game Play; 16.2 The Structure of the Game; 16.3 Game Setup; 16.4 Drawing the Border; 16.5 Displaying the Score; 16.6 Ending the Game; 16.7 What You Learned; 16.8 Programming Challenges; Chapter 17: Making a Snake Game: Part 2; 17.1 Building the Block Constructor; 17.2 Creating the Snake; 17.3 Moving the Snake; 17.4 Setting the Snake's Direction with the Keyboard; 17.5 Creating the Apple; 17.6 Putting It All Together; 17.7 What You Learned; 17.8 Programming Challenges; Afterword: Where To Go From Here; More JavaScript; Web Programming; Graphical Programming; 3D Programming; Programming Robots; Audio Programming; Game Programming; Sharing Your Code Using JSFiddle; Glossary; Updates; More Smart Books for Curious Kids!;