User Tools

Site Tools


eg-259:review:javascript02

Review Questions

Adapted from: Chapter 4 of Robert W. Sebasta, Programming the World-Wide Web, 3rd Edition, Addison Wesley, 2006. Supporting: Contact Hour 8.

  1. What is a control construct?
  2. Must the then clause of an if statement in JavaScript always be a compound statement?
  3. What are the three possible forms of control expressions in JavaScript?
  4. What is the difference between == and ===?
  5. Explain what short-circuit evaluation of an expression means.
  6. What are the semantics of a break statement?
  7. What is the difference between a while statement and a do-while statement?
  8. When is a JavaScript constructor called?
  9. What is the difference between a constructor in Java and one in JavaScript?
  10. What properties does an object created with a new operator and the Object constructor have?
  11. Describe the two ways the properties of an object can be referenced.
  12. How is a new property of an object created?
  13. Describe the semantics of the for-in statement.
  14. Describe the two ways an Array object can he created.
  15. What exactly does a constructor do in JavaScript?
  16. What relationship is there between the value of the length property of an Array object and the actual number of existing elements in the object?
  17. Describe the semantics of the join method of Array.
  18. Describe the semantics of the slice method when it is given just one parameter.
  19. What is the form of a nested array literal?
  20. What value is returned by a function that contains no return statement?
  21. Define the scope of a variable in a JavaScript script embedded in an XHTML document when the variable is not declared in a function.
  22. Is it possible to reference global variables in a JavaScript function?
  23. What is the advantage of using local variables in functions?
  24. What parameter-passing method does JavaScript use?
  25. Does JavaScript check the types of actual parameters against the types of their corresponding formal parameters?
  26. How can a function access actual parameter values for those actual parameters that do not correspond to any formal parameter?
  27. What is one way in which primitive variables can be passed by reference to a function?

More Review Questions

eg-259/review/javascript02.txt · Last modified: 2012/02/10 17:01 by eechris