Q. When will the browser invoke the handler?

  • (A) Program begins
  • (B) Any event occurs
  • (C) Specified event occurs
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) Specified event occurs

Q. An _______ is a special variable, which can hold more than one value

  • (A) string
  • (B) integer
  • (C) character
  • (D) array
πŸ’¬ Discuss
βœ… Correct Answer: (D) array

Q. It is a common practice to declare arrays with the _________ keyword.

  • (A) var
  • (B) let
  • (C) const
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) const

Q. Spaces and line breaks are not important.

  • (A) True
  • (B) False
  • (C) Can be true or false
  • (D) Can not say
πŸ’¬ Discuss
βœ… Correct Answer: (A) True

Q. Array indexes start with ______.

  • (A) -1
  • (B) 0
  • (C) 1
  • (D) Can not say
πŸ’¬ Discuss
βœ… Correct Answer: (B) 0

Q. The ________ operator in JavaScript returns "object" for arrays.

  • (A) typeof
  • (B) not
  • (C) or
  • (D) and
πŸ’¬ Discuss
βœ… Correct Answer: (A) typeof

Q. What is true about Arrays?

  • (A) JavaScript does not support associative arrays
  • (B) You should use objects when you want the element names to be strings
  • (C) You should use arrays when you want the element names to be numbers
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. The easiest way to add a new element to an array is using the _________ method

  • (A) set()
  • (B) push()
  • (C) insert()
  • (D) add()
πŸ’¬ Discuss
βœ… Correct Answer: (B) push()

Q. The _______ method also joins all array elements into a string.

  • (A) shift()
  • (B) pop()
  • (C) join()
  • (D) toString()
πŸ’¬ Discuss
βœ… Correct Answer: (C) join()

Q. Array elements can be deleted using the JavaScript operator?

  • (A) pop
  • (B) shift
  • (C) delete
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above