Javascript Lessons
01. Statements

javascript program is a list of statements to be executed by a computer

  1. declare 3 variables
  2. assign the value 5 to x
  3. assign the value 6 to y
  4. assign the sum of x + y
  5. document the statement by finding the div id demo_01 and write the statement inside the HTML file
  6. finally, you document where the answer should show up, we are using demo_numbers for each example



02. Strings

Strings are written with double or single quotes. you have used both in previous lessons]



03. Varibles

in this example, we declare the Varibles as words:

  1. declare the variable price1 and price 2
  2. assign the value of 5 to price1
  3. assign the value of 6 to price2
  4. assign the value of price1 + price2 to toal
  5. finally you document where the answer should show up, we are using demo_numbers for each each example



04. Operators

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

  1. assign the value of 5 to x
  2. assign the value of 2 to y
  3. assign the value of 7 to z
  4. finally you document where the answer should show up, we are using demo_numbers for each examples



05. Data Types

javascript evaluates expressions from left to right. different sequences can produce different results



06. Booleans

booleans can have two values: true or false

  1. assign the value of 5 to x
  2. assign the value of 5 to y
  3. assign the value of 6 to z
  4. 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