Computer Programming: Are You Ready To Take The JavaScript Quiz!

11 Questions | Total Attempts: 243

SettingsSettingsSettings
Please wait...
Computer Programming: Are You Ready To Take The JavaScript Quiz!

.


Questions and Answers
  • 1. 
    Var a = ""; var b = ['foo', 'max', 'mike']; Make a = "foomaxmike" in a single line of code.
  • 2. 
    If you have seen all the data types in Javascript, then you have seen a new data type in JavaScript called Symbol. Can you tell me what is the use of it?
  • 3. 
    How to delete cookies in JavaScript?
  • 4. 
    Create a function that, given a DOM Element on the page, will visit the element itself and all of its descendents (not just its immediate children). For each element visited, the function should pass that element to a provided callback function. The arguments to the function should be: 1.) a DOM element 2.) a callback function (that takes a DOM element as its argument)
  • 5. 
    Detect the console value of the following line of code. function Foo(a,b,c){ this.x = a; this.y = b; this.z = c; } var m = Foo(3,4,5); var k = {}; Foo.call(k,3,4,5); console.log(k); console.log(m);
    • A. 

      {}, {}

    • B. 

      {3,4,5}, {}

    • C. 

      {3,4,5}, {3,4,5}

    • D. 

      {3,4,5}, undefined

  • 6. 
    How many data types are there in javascript?
    • A. 

      5

    • B. 

      6

  • 7. 
    Var k = {} k[Symbol('lorem')] = "Max"; k[Symbol('lorem')] = "Payne"; console.log(k[Symbol('lorem')]);console value is?
    • A. 

      "Max"

    • B. 

      "Payne"

    • C. 

      Undefned

  • 8. 
    Is  "" == 0?
    • A. 

      True

    • B. 

      False

  • 9. 
    (function(){ var a = b = 3; })(); console.log(typeof a !== 'undefined'); console.log(typeof b !== 'undefined'); what are console values of above?
    • A. 

      True, true

    • B. 

      True, false

    • C. 

      False, true

    • D. 

      False, false

  • 10. 
    What is the output of console.log(0.1 + 0.2 == 0.3)?
    • A. 

      True

    • B. 

      False

  • 11. 
    What is console.log(1 && 2);
    • A. 

      0

    • B. 

      1

    • C. 

      2

    • D. 

      3