javascript program is a list of statements to be executed by a computer
- declare 3 variables
- assign the value 5 to x
- assign the value 6 to y
- assign the sum of x + y
- document the statement by finding the div id demo_01 and write the statement inside the HTML file
- finally, you document where the answer should show up, we are using demo_numbers for each example
Strings are written with double or single quotes. you have used both in previous lessons]
in this example, we declare the Varibles as words:
- declare the variable price1 and price 2
- assign the value of 5 to price1
- assign the value of 6 to price2
- assign the value of price1 + price2 to toal
- finally you document where the answer should show up, we are using demo_numbers for each each example
the assignment (=) operator assigns a value to a variable. Other operators include signs such as equal, plus, subtraction, multiplication, division, percentage and combination of these signs
- assign the value of 5 to x
- assign the value of 2 to y
- assign the value of 7 to z
- finally you document where the answer should show up, we are using demo_numbers for each examples
javascript evaluates expressions from left to right. different sequences can produce different results
booleans can have two values: true or false
- assign the value of 5 to x
- assign the value of 5 to y
- assign the value of 6 to z
- finally you document where the answer should show up, we are using demo_numbers for each example. in this example we add, does x (equal) y, and does x (equal) z