Javascript Variables

Description

Javascript Quiz on Javascript Variables, created by Rene Escobar on 17/12/2014.
Rene Escobar
Quiz by Rene Escobar, updated more than 1 year ago
Rene Escobar
Created by Rene Escobar almost 10 years ago
803
0

Resource summary

Question 1

Question
Which of these variables are not valid in Javascript?
Answer
  • 4_colors
  • Color
  • color
  • $color

Question 2

Question
What happens when you declare a variable like var myVar;
Answer
  • The variable value(output) is set to undefined
  • The variable value(output) is set to null

Question 3

Question
What are some of the main differences between null and undefined?
Answer
  • 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"

Question 4

Question
=== operator is less strict in terms of identifying equality than ==
Answer
  • True
  • False

Question 5

Question
Variables created inside of a function can only be used within the function
Answer
  • True
  • False

Question 6

Question
Which var world is considered to have a global scope?
Answer
  • var date; function sayHello(){ }
  • function sayHello(){ var date; }

Question 7

Question
What will console log out in the following code? var part1 = "Team "; function bam() { var part2 = "Treehouse"; console.log(part2); } bam();
Answer
  • Treehouse
  • Undefined
  • Team

Question 8

Question
Declaring a variable without a var keyword will evaluate the variable with global scope
Answer
  • True
  • False
Show full summary Hide full summary

Similar

Quiz - Object Oriented Javascript
arunram.krish
Examen Fundamentos Basicos de Programación
Jose Valderrama0721
Test I. Introduction to web technologies
Angel Martínez Rodriguez
JavaScript Fundamentals
Andrew Watters
Front-End Web Development
Chanthy Ngin
Javascript - Quiz - Jan 2016
arunram.krish
OpenSource Programming
Faheem Ahmed
Javascript basics
James Drummond
jQuery Basics functions and method
Victor Bini
JavaScript DOM API - Funções Basicas - Interactive Web Pages
Victor Bini
Programming
Herbert Fortes