Which of these variables are not valid in Javascript?
4_colors
Color
color
$color
What happens when you declare a variable like var myVar;
The variable value(output) is set to undefined
The variable value(output) is set to null
What are some of the main differences between null and undefined?
Null is used to tell the program that a value is truly empty
Unlike undefined, null is a falsy value
typeof null will return "Object" and typeof undefined returns "undefined"
=== operator is less strict in terms of identifying equality than ==
Variables created inside of a function can only be used within the function
Which var world is considered to have a global scope?
var date; function sayHello(){ }
function sayHello(){ var date; }
What will console log out in the following code? var part1 = "Team ";
function bam() { var part2 = "Treehouse"; console.log(part2); }
bam();
Treehouse
Undefined
Team
Declaring a variable without a var keyword will evaluate the variable with global scope