JavaScript for Kids: A Playful Introduction to Programming

By Nick Morgan

JavaScript is the programming language of the net, the key sauce that makes the internet notable, your favourite websites interactive, and on-line video games fun!

JavaScript for Kids is a lighthearted advent that teaches programming necessities via sufferer, step by step examples paired with humorous illustrations. you will start with the fundamentals, like operating with strings, arrays, and loops, after which flow directly to extra complex themes, like development interactivity with jQuery and drawing snap shots with Canvas.

Along the way in which, you will write video games comparable to locate the Buried Treasure, Hangman, and Snake. you will additionally learn the way to:

  • Create features to prepare and reuse your code
  • Write and regulate HTML to create dynamic internet pages
  • Use the DOM and jQuery to make your web content react to person input
  • Use the Canvas point to attract and animate graphics
  • Program genuine user-controlled video games with collision detection and rating keeping

With visible examples like bouncing balls, lively bees, and racing automobiles, you could rather see what you are programming. every one bankruptcy builds at the final, and programming demanding situations on the finish of every bankruptcy will stretch your mind and encourage your individual extraordinary courses. Make anything cool with JavaScript today!

Ages 10+ (and their parents!)

Show description

Preview of JavaScript for Kids: A Playful Introduction to Programming PDF

Best Children books

Ratburger

This is often the 5th hilarious and touching novel from David Walliams: #1 bestseller and quickest turning out to be children's writer within the state.

Guys Read: Thriller

A physique at the tracksA teenage terroristA mysterious wish-granting machineThe world’s worst deepest detectiveThe moment quantity within the men learn Library of serious studying is brim-full of puzzle, intrigue, and nefarious job. that includes the very best writers round, and compiled by way of qualified man Jon Scieszka, men learn: mystery is a pulse-pounding choice of brand-new brief tales, every one sure to hold you riveted till the ultimate web page.

Odd Girl Speaks Out: Girls Write about Bullies, Cliques, Popularity, and Jealousy

The nationwide bestseller abnormal woman Out uncovered a hidden tradition of cruelty that had continuously been quietly persevered by way of American women. As Rachel Simmons toured the rustic, those women came across their voices and spoke to her approximately their discomfort. They desired to talk-and they were not the single ones. moms, lecturers, counselors, younger specialist girls, even fathers, got here to Rachel with heart-wrenching own tales which may not be stored mystery.

Brian's Return

As hundreds of thousands of readers of Hatchet, The River, and Brian's wintry weather understand, Brian Robeson survived on my own within the barren region through discovering recommendations to striking demanding situations. yet now that is he is again in civilization, he cannot give you the chance to make feel of highschool existence. He feels disconnected, extra remoted than he did on my own within the North.

Additional info for JavaScript for Kids: A Playful Introduction to Programming

Show sample text content

121 #3: restricting Guesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 #4: solving a malicious program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 eight Functions 123 the elemental Anatomy of a functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 making a easy functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Calling a functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . one hundred twenty five Passing Arguments into services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Printing Cat Faces! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Passing a number of Arguments to a functionality . . . . . . . . . . . . . . . . . . 128 Returning Values from features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 utilizing functionality Calls as Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 utilizing capabilities to Simplify Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 A functionality to choose a Random be aware . . . . . . . . . . . . . . . . . . . . . . . . 132 A Random Insult Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Making the Random Insult Generator right into a functionality . . . . . . . . . 134 Leaving a functionality Early with go back . . . . . . . . . . . . . . . . . . . . . . . . . . . . one hundred thirty five utilizing go back a number of instances rather than if... else Statements . . . . . . . . . . 136 What You discovered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Programming demanding situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 number one: Doing mathematics with capabilities . . . . . . . . . . . . . . . . . . . . . . . 138 #2: Are those Arrays a similar? . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 #3: Hangman, utilizing capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 xiv  Contents intimately Part II: complex JavaScript nine The DOM and jQuery 143 making a choice on DOM parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . one hundred forty four utilizing identity to spot parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . one hundred forty five settling on a component utilizing getElementById . . . . . . . . . . . . . . . . one hundred forty five changing the Heading textual content utilizing the DOM . . . . . . . . . . . . . . . . . 146 utilizing jQuery to paintings with the DOM Tree . . . . . . . . . . . . . . . . . . . . . . . . 148 Loading jQuery in your HTML web page . . . . . . . . . . . . . . . . . . . . . . . 148 exchanging the Heading textual content utilizing jQuery . . . . . . . . . . . . . . . . . . . 148 growing New parts with jQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a hundred and fifty Animating parts with jQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Chaining jQuery Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 What You realized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Programming demanding situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 no 1: directory your pals with jQuery (And Making Them odor! ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 #2: creating a Heading Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 #3: Delaying Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 #4: utilizing fadeTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 10 Interactive Programming one hundred fifty five Delaying Code with setTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Canceling a Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Calling Code a number of occasions with setInterval . . . . . . . . . . . . . . . . . . . . . . 158 Animating parts with setInterval . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Responding to person activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Responding to Clicks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 The mousemove occasion .

Download PDF sample

Rated 4.36 of 5 – based on 16 votes