Account Log In - Home/Outlines - Books - Contact Us - Support - Employment -

DHTML

JavaScript Programming Fundamentals

Review Answers

  1. Why is it a good idea to comment your code?
    You may want to remember what you did at some point in the future. Commenting your code is like writing notes to yourself. It is also a good idea if someone else will be working with your code.
  2. What do methods do?
    Methods allow you to tell an object to do something.
  3. What is an event handler?
    It allows JavaScript to recognize user events, like a mouse click, and then it allows you to specify what will happen when an event occurs.
  4. How does JavaScript separate things like objects, properties and methods?
    It separates them with a dot (.). This is referred to as "dot syntax".
  5. What does the alert() method do?
    It pops up a box with either some text, or the contents of a variable, and an "OK" button.
  6. How can you tell the browser to ignore a character in JavaScript?
    By using the escape character (\).
  7. What is the difference between declaring a variable and assigning it a value?
    Assigning a variable a value puts something into the variable. A variable is declared when it first shows up in the script. You can declare a variable without assigning it a value.
  8. What can variables contain?
    Text strings, numeric values, or boolean values.
  9. How can you turn an existing variable into a string?
    By using the String(some_variable) method.
  10. What does the JavaScript prompt() method allow you to do?
    It allows you to get information from the user, in the form of a text string.
  11. What does indexOf() do?
    It searches a string for whichever character is contained inside the parentheses.
  12. What does substring() do?
    It returns the part of the string specified by the start and end positions inside the parentheses.
  13. How can you increment a variable by one?
    By using the ++ operator.
  14. What do comparison operators do?
    They compare 2 values together, and return a value of true or false.
  15. What part of an expression will JavaScript give precedence to?
    It will give precedence to whatever is enclosed in parentheses.
  16. When will the part of the conditional inside the curly braces be run?
    When the result of the comparison expression is true.
  17. What does the parseInt() global function do?
    It is used to convert a string to a number (integer).
  18. What do the built in parameters of the for loop do?
    1. The first parameter specifies the initial value of the counter variable.
    2. The second parameter test to see if a condition is true.
    3. The third parameter is used to increment or decrement the variable.
  19. What is the confirm() method used for?
    It is used to get a yes or no answer from the user, and returns true or false depending on the answer.
  20. How are functions useful when programming JavaScript?
    They allow you to run the same code over and over again, as needed. They also only run when called.
  21. What are function parameters?
    They are usually variables that are passed to the function when it is called.
  22. What is a local variable?
    It is a variable the is declared inside the function, and cannot be accessed outside the function.
  23. What is an array?
    An array is a variable that contains a list of items.
  24. How can arrays be used with for loops?
    The for loop can be used to loop through the items in the array until the end of the array is reached.
  25. What are built in arrays?
    Many elements of a page are automatically part of an array. This is called an internal array.

Coming Soon:

Feb 13
ISSD 24 - XML
Feb 14
Web Design Level 4: XHTML Advanced
Feb 21
ISSD 23 - Web 2.0 Technology
Feb 23
Facebook for Business
Hours: 2
Cost: Free!
Feb 25
Search Engine Optimization (SEO)
Hours: 2
Cost: Free!
Feb 25
Search Engine Marketing (SEM)
Hours: 2
Cost: Free!
Feb 27
ISSD 24 - OLDB (Online Databases with MySQL and PHP)
Mar 05
ISSD 23 - Ajax
Mar 20
Web Design Level 5: DHTML Introduction


DHTML - TOC - Introduction - Books -
JavaScript Programming Fundamentals - Links - [ Answers ] -
Questions -

DHTML - TOC - Introduction - Books -
JavaScript Programming Fundamentals - Links - [ Answers ] -
Questions -