Javascript questions

The following list indicates, without restriction, the kinds of questions that could be asked. On exams you will be given a choice of 5 potential answers.
  1. Within an HTML file JavaScript appears inside which HTML element ?
  2. In JavaScript variables can hold what types of values ?
  3. In JavaScript multiple line comments are surrounded with what characters ?
  4. In JavaScript, after executing var x = "hello"; then if you wanted to have var z have the value of the number of characters in x, what JavaScript would you use ?
  5. Which of the following is not a fundamental type in JavaScript ?
  6. In JavaScript, given an object instance o, in order to access o's property prop, and o's method method(), what Javascript would you would use ?
  7. In JavaScript, which of the following is not a valid comparison operator ?
  8. JavaScript programming for the web is described as event driven because …
  9. In JavaScript, the Number type is used to represent what ?
  10. In JavaScript, strings are what ?
  11. JavaScript has the following looping constructs
  12. In order to declare the variable 'foo' explicitly in JavaScript, one would write what ?
  13. In JavaScript, in addition to normal values, there are two special values 'undefined' and 'null'. The difference between these two values is what ?
  14. The value of the JavaScript expression "2 + 2 " + 3 + 4 is what ?
  15. The difference between the comparison operators == and === is what ?
  16. Which sequence of numbers does the variable x take on in the following loop. var x = 7; while(x >= 0) {x -= 2;}
  17. Which sequence of numbers does the variable x take on in the body of the following loop. var x = 4; while (x < 200) {x = 2*x+2;}
  18. Given that x = "abcdefgdefg", what value does x.indexOf("def") return ?
  19. Which of the following JavaScript errors cannot be detected by JSLint ?
  20. Given var x = "0", y = "5"; what is the result of y+x+"0"
  21. Given var x = {desc:"description"}; var y = {next:x, desc:"empty"}; what is the value of y.next.previous
  22. What does the statement document.getElementsByClass("h1") return ?
  23. Which of the following loops generate the sequence 0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20 ?
  24. The following JavaScript code fragment var i=0; while (i < 10) { alert("hi"); i += 1;} creates how many alert boxes ?
  25. After the execution of the following code fragment, var x=6; var i=0; while (i < 5) {var j=0; while (j < 3) { x = x+1; j += 1} i += 1 } x has the value ?
  26. After the execution of the following code fragment, var x = 2; var y = 2; var z = 6; if((x == y) && (z < 7)){ if(x === 2) { z = 7; } else { z = 2; } } else { z = 8; } z has the value ?
  27. After execution of the JavaScript fragment var x= ["a", "b","c"] is ?
  28. Which of the following is not a valid JavaScript variable name ?
  29. In JavaScript, which of the following is interpreted as being true in a logical expression
  30. In JavaScript, which of the following is interpreted as being false in a logical expression
  31. The difference between the comparison operators == and === is what ?
  32. In JavaScript, in addition to normal values, there are two special values 'undefined' and 'null'. The difference between these two values is what ?
  33. The statement "use strict"; in a JavaScript function does what ?
  34. If the JavaScript code var x = 1 + +"2" + "2"; is executed, then x has what value ?
  35. In the JavaScript code fragment var i=1; while(i <=5) {i+=2; … } within the … in the loop body i has values in what order ?
  36. JavaScript has what loop constructs ?
  37. Which JavaScript loop constructs does JSLint reject ?
  38. In order to declare the variable 'foo' explicitly in JavaScript, one would write what ?
  39. In JavaScript-HTML, a cookie is what ?
  40. After execution of the following JavaScript fragment var z = 2; var x = 3; var q = (z == 2) || (x== 5); then q has what value ?
  41. Which of the following is not a reserved word in JavaScript ?
  42. Unit testing is what ?
  43. JavaScript functions can do which of the following ?
  44. After execution of the following JavaScript fragment var x = 1/0 * -1; x has what value ?
  45. After execution of the following JavaScript fragment var x = 1/0 - 1/0; x has what value ?
  46. In Javascript string are immutable, this means what ?
  47. In Javascript how do you round a number to 2 decimal places ?