Rene Escobar
Quiz by , created more than 1 year ago

Javascript Quiz on Javascript Variables, created by Rene Escobar on 17/12/2014.

803
0
0
Rene Escobar
Created by Rene Escobar almost 10 years ago
Close

Javascript Variables

Question 1 of 8

1

Which of these variables are not valid in Javascript?

Select one of the following:

  • 4_colors

  • Color

  • color

  • $color

Explanation

Question 2 of 8

1

What happens when you declare a variable like
var myVar;

Select one of the following:

  • The variable value(output) is set to undefined

  • The variable value(output) is set to null

Explanation

Question 3 of 8

1

What are some of the main differences between null and undefined?

Select one or more of the following:

  • 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"

Explanation

Question 4 of 8

1

=== operator is less strict in terms of identifying equality than ==

Select one of the following:

  • True
  • False

Explanation

Question 5 of 8

1

Variables created inside of a function can only be used within the function

Select one of the following:

  • True
  • False

Explanation

Question 6 of 8

1

Which var world is considered to have a global scope?

Select one of the following:

  • var date;
    function sayHello(){
    }

  • function sayHello(){
    var date;
    }

Explanation

Question 7 of 8

1

What will console log out in the following code?
var part1 = "Team ";

function bam() {
var part2 = "Treehouse";
console.log(part2);
}

bam();

Select one of the following:

  • Treehouse

  • Undefined

  • Team

Explanation

Question 8 of 8

1

Declaring a variable without a var keyword will evaluate the variable with global scope

Select one of the following:

  • True
  • False

Explanation