What is JavaScript?

  1. What's the purpose of adding site: and a domain name to a Google or Bing search?




    B. To limit the search results to one website (rather than the entire Web)
  2. If you executed var lookfor = document.getElementByld("txtlookfor").value,; what would be the result?




    D. It creates a variable named lookfor and stores in it whatever the user typed into a textbox named txtlookfor
  3. If you have a variable named x and it contains the string "Hello", what would be the return value of x.length in JavaScript code?




    C. 5
  4. If your JavaScript code contains two variables named str1 and str2, and if both f those variable contain strings (text), not numbers, what would the expression str1+str2 return?




    D. A new string with whatever letters were in str2 removed from str1
    A. A new string consisting of str1 and str2 joined together
  5. Why would you use the word selected in the <option> tag of a drop-down list control?




    C. To make the specified option the default selection
  6. Which are the recommended audio types for HTML5 audio?




    A. MP3 and OGG
  7. Which JavaScript property determines if the user's Web browser can play a particular type of sound file?

    A. .getMimeAttribute()
    B. .canPlayType()
    C. .willPlayMime()
    D. .playsFileType()
  8. What JavaScript method allows you to specify a sound file for an HTML audio object to play?




    D. .setAttribute()
  9. Which JavaScript property allows you to control the volume of sound through JavaScript?




    D. .volume()
  10. Which line of JavaScript code below could you use to make an element named goober invisible on a page?




    B. goober.style.display="none"
  11. If you add a line of JavaScript code that reads var harmony=10 in the head section of a page, right under the <script> tag, what type of variable would howmany be in terms of scope?




    C. Global
  12. If a function named myfunc() contains the line var x=10; what would be the scope of that x variable?




    D. It's local to myfunc(), exists only while myfunc() is executing, and it's inaccessible to other JavaScript functions on the page
  13. If a variable named x contains Hello World, what would x.indexOf("W")return?




    B. 6
  14. If variable personname contains the string Joan Doe, what would the expression personname.substr(5,3) return?




    A. Doe
  15. What is the purpose of the parselnt() function?




    B. To convert a string to an integer
  16. If you define an array using var artists=[*Bach*,*Beethoven*,*Mozart*]; what value would be assigned to artist[1]?




    A. Beethoven
  17. If you create a short array using the syntax var big3=["Chewy","Ford", "Chrysler"]; what would the expression big3.length return after doing so?




    D. 3
  18. If you start a loop with for (var i=10, i <= 100; i += 10), how many times will that loop repeat?




    A. 10
  19. What is the meaning of the JavaScript++ operator?




    C. Increment the value by 1
  20. Which JavaScript construct is often used in place of a long series of if...else statements when there are many options to consider?




    B. Switch statement
Author
jdavis123
ID
355483
Card Set
What is JavaScript?
Description
5-8
Updated