Test your JavaScript knowledge -1

Test your JavaScript, following are the some simple questions of JavaScript. consider every question has 5 mark. if you select correct answer, you will get 5 otherwise 0. so lets start….

  1. JavaScript is not an interpreted language.
  2. (a) True (b) False

  3. The external JavaScript file must contain the contain the ‘script’ tag
  4. (a) True (b) False

  5. How do you create a function?
  6. (a) function:CreateFun() (b) function=CreateFun() (c) function CreateFun()

  7. How does a “while” loop start?
  8. (a) while i=1 to 10 (b) while (i<=10;i++) (c) while (i<=10)

  9. Text fields accept a single line of text entry.
  10. (a) True (b) False

  11. JavaScript does not allow the data type of the variable to be declared when a variable is created.
  12. (a) True (b) False

  13. Which operator calculates the remainder by dividing two integers.
  14. (a) % (b) / (c) * (d) —

  15. How can you add a comment in a JavaScript?
  16. (a) ‘This is a comment (b) (c) //This is a comment

  17. How do you find the number with the highest value of x and y?
  18. (a) ceil(x,y) (b) Math.max(x,y) (c) Math.ceil(x,y) (d) top(x,y)

  19. How can you find a client’s browser name?
  20. (a) client.navName (b) navigator.appName (c) browser.name)