'use strict' x = 7 // is an error unless x has already been declared
let y = 5; console.log(y, "is of type", typeof y); y = "hello world"; console.log(y, "is of type", typeof y); y = ['a','b','c'] console.log(y, "is of type", typeof y);
5 "is of type" "number" hello world is of type string ["a", "b", "c"] "is of type" "object"
let z console.log(z, typeof z) console.log(typeof z === "undefined") console.log(z === undefined);
undefined "undefined" true true
let name = "bob"; let otherName = name;
otherName = otherName + "'s" otherName += " house";
console.log("The length of '"+name+"' is "+name.length
console.log("The first letter of '"+name+"' is "+ name[0])
console.log('checking "3"== 3', "3" == 3) console.log('checking "3"=== 3', "3" === 3)
function FunctionName(param [=value], param[=value]...) { body return }
function StringPass(a, b="hello") { console.log("\tIn String Pass a = '"+a+"'"); console.log("\tIn String Pass b = '"+b+"'"); a = "world"; b = ""; } let str1 = "blank string"; StringPass(str1); console.log("str1 = '" + str1 + "'");
let list1=[1,2,3]; StringPass(list1);