Essential Question: What data types does JavaScript use and how are they different from the other programming languages that I learned?
Mastery Objectives:
SWBAT create variables using the different data types in JavaScript.
Do Now: Write a JavaScript program to calculate days left until next New Year's Eve.
Directions: Create a program in repl.it to demonstrate each type of data type. Call the program, Data Types.
On line 1 write your age to the console. This is a number.
On line 2 write your name to the console. This is a string.
To declare variables, write var then the name of the variable. For example, var Name = "Ms. Moylan"
On line 3 set the variable varBoolean equal to true. Write varBoolean to the console. This is a boolean.
On line 4 set the variable varNull equal to null. Write the varNull to the console. This is null.
On line 5 set the variable var car = {type:"Fiat", model:"500", color:"white"};Â This is an object.
On line 6 set the variable group to a list of your friends. Here is an example: var Friends = {1:"John", 2:"Luis", 3:"Sarah", 4: "Ahmad"} Write your Friends object to the console.
Run your code and take a screenshot of it. Upload your screenshot to google classroom.