Q. What is the purpose of image replacement?

  • (A) To replace an image
  • (B) To implement special effects
  • (C) Implementation of image rollovers
  • (D) Removal of image rollovers
πŸ’¬ Discuss
βœ… Correct Answer: (C) Implementation of image rollovers

Q. Consider the following code snippet . What will be the result?

Code:
var a1 = [,,,]; 
var a2 = new Array(3); 
0 in a1 
0 in a2
  • (A) true false
  • (B) true true
  • (C) false true
  • (D) false true
πŸ’¬ Discuss
βœ… Correct Answer: (A) true false

Q. The pop() method of the array does which of the following task ?

  • (A) decrements the total length by 1
  • (B) increments the total length by 1
  • (C) prints the first element but no effect on the length
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (A) decrements the total length by 1

Q. When is JavaScript called obtrusive?

  • (A) JavaScript code is medium sized
  • (B) JavaScript code is so large
  • (C) JavaScript code is so small
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) JavaScript code is so large

Q. What will be the output of following Javascript code:

Code:
if (!a[i]) continue ;
  • (A) Skips the undefined elements
  • (B) Skips the null elements
  • (C) Skips the non existent elements
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned

Q. What will happen if reverse() and join() methods are used simultaneously ?

  • (A) Reverses and concatenates the elements of the array
  • (B) Reverses and stores in the same array
  • (C) Reverses
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Reverses and stores in the same array

Q. Which is a possible way of finding all the img elements in the document?

  • (A) document.images[]
  • (B) document(images)
  • (C) document(img)
  • (D) all of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) document.images[]

Q. What will be the output of following Javascript code:

Code:
var a = [1,2,3,4,5];
a.slice(0,3);
  • (A) Returns [1,2,3]
  • (B) Returns [1,2,3,4,5]
  • (C) Returns [4,5]
  • (D) Returns [1,2,3,4]
πŸ’¬ Discuss
βœ… Correct Answer: (A) Returns [1,2,3]

Q. What will be the output of following Javascript code:

Code:
var a = []; 
a.unshift(1); 
a.unshift(22);
a.shift(); 
a.unshift(3,[4,5]); 
a.shift(); 
a.shift();
a.shift();
  • (A) 1
  • (B) [3,4,5]
  • (C) [4,5]
  • (D) Exception is thrown
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1

Q. Which of the following elements are used to include audio?

  • (A) video
  • (B) audio
  • (C) svg
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) audio