Variables can store a large variety of information.
They can store numbers: var x = 250;
They can store words: var name = "Teddy";
they can store boolean values: var crashed = true;
In order to declare a variable, we need to use the keyword var
followed by the name of the variable
Afterwords we can reference it by using the name we gave it.
Example
var myNumber = 0; myNumber = 10; myNumber = myNumber + 5; myNumber = myNumber * 2; console.log(myNumber)
In this course we will transition from block-based Scratch programming into text-based JavaScript!
In this course we will transition from block-based Scratch programming into text-based JavaScript!
Learn the fundamentals of JavaScript by building your own game
In this course we will transition from block-based Scratch programming into text-based JavaScript!
In this lesson we are going to use what we learned about animation in JavaScript to animate the house we drew earlier in the course!
In this lesson we will learn about variables, if statements, operators, and the draw function so we can make things move around using JavaScript!
We will begin our understanding of JavaScript by looking at how to store data in memory
Free Trial (5th - 7th)
Create a basic code clicker game