HR/Admin : +91-7827547816
Sales : +91-7827547816
+91-9599109956
training@techspakes.com
Toggle navigation
Home
Training Courses
HTML
Website Development
WordPress Development
Front End Development
Graphics Designer
Linux Admin
MERN
Angular
Hybrid Mobile App
Drupal
Full Stack
React Native Developer
MVC
MEAN
SMM
SEO
SMO
Lead Generation
Web Development Training in Noida
Web Development Training in Jaipur
Computer Training in Narnaul
Computer Training in Satnali
Our Locations
Computer Training in Dahina
Computer Training in Mahendergarh
Computer Training in Narnaul
Computer Training in Satnali
Computer Training in Rewari
Computer Training in Kanina
Computer Training in Ateli Mandi
Computer Training in Bhiwani
Computer Training in Charkhi Dadri
Interview Questions
HTML Interview Questions
CSS Interview Questions
Bootstrap4 Interview Questions
Bootstrap5 Interview Questions
Javascript Interview Questions
IT Services
Testimonial
Our Top Placements
Contact
Top 500 Javascript MCQ Interview Questions
Training
Top 500 Javascript MCQ Interview Questions
Question 301:
Which of the following is a method for converting a JSON string into a JavaScript object?
A) JSON.stringify()
B) JSON.parse()
C) JSON.convert()
D) JSON.decode()
Answer:
B) JSON.parse()
Question 302:
What is the output of console.log(typeof NaN);?
A) number
B) NaN
C) undefined
D) error
Answer:
A) number
Question 303:
Which symbol is used to denote a block comment in JavaScript?
A) //
B) /* */
C) #
D) Both A and B
Answer:
D) Both A and B
Question 304:
What does the this keyword refer to in a JavaScript function?
A) The function itself
B) The global object
C) The object from which the function was called
D) None of the above
Answer:
C) The object from which the function was called
Question 305:
Which of the following will create an object in JavaScript?
A) let obj = {};
B) let obj = new Object();
C) let obj = Object.create(null);
D) All of the above
Answer:
D) All of the above
Question 306:
What is the output of console.log('5' + 5);?
A) 10
B) 55
C) undefined
D) error
Answer:
B) 55
Question 307:
Which of the following is the correct way to define an array in JavaScript?
A) let arr = {1, 2, 3};
B) let arr = [1, 2, 3];
C) let arr = (1, 2, 3);
D) let arr = <1, 2, 3>;
Answer:
B) let arr = [1, 2, 3];
Question 308:
What is the output of console.log(typeof null);?
A) object
B) null
C) undefined
D) error
Answer:
A) object
Question 309:
Which method is used to remove the last element from an array in JavaScript?
A) pop()
B) shift()
C) slice()
D) delete()
Answer:
A) pop()
Question 310:
Which of the following methods can be used to convert a string to an integer in JavaScript?
A) parseInt()
B) Number()
C) Both A and B
D) None of the above
Answer:
C) Both A and B
Question 311:
What is the output of console.log(3 > 2 > 1);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 312:
Which of the following methods will sort an array in place?
A) sort()
B) slice()
C) concat()
D) map()
Answer:
A) sort()
Question 313:
What is the output of console.log('Hello' + 'def');?
A) abcdef
B) abc def
C) abc+def
D) error
Answer:
A) abcdef
Question 314:
Which function is used to get the current date and time in JavaScript?
A) Date()
B) new Date()
C) getDate()
D) currentDate()
Answer:
B) new Date()
Question 315:
What will console.log('Hello' === 'Hello'); output?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 316:
Which of the following is used to define an asynchronous function in JavaScript?
A) async
B) await
C) promise
D) defer
Answer:
A) async
Question 317:
What is the output of console.log(typeof []);?
A) array
B) object
C) undefined
D) error
Answer:
B) object
Question 318:
Which of the following is a JavaScript framework?
A) React
B) Angular
C) Vue
D) All of the above
Answer:
D) All of the above
Question 319:
What is the output of console.log(1 == '1');?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 320:
Which of the following keywords is used to declare a constant in JavaScript?
A) let
B) const
C) var
D) define
Answer:
B) const
Question 321:
What does parseInt('100.10') return?
A) 100.10
B) 100
C) undefined
D) error
Answer:
B) 100
Question 322:
What is the output of console.log(0 == false);?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 323:
Which method can be used to convert a string to a number?
A) Number()
B) parseFloat()
C) parseInt()
D) All of the above
Answer:
D) All of the above
Question 324:
What is the output of console.log([2] == [2]);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 325:
What is the output of console.log(null === undefined);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 326:
Which of the following is used to stop the execution of a function?
A) break
B) return
C) continue
D) stop
Answer:
B) return
Question 327:
What will console.log(typeof function(){}); output?
A) function
B) object
C) undefined
D) error
Answer:
B) object
Question 328:
Which of the following methods is used to remove the last element from an array?
A) pop()
B) shift()
C) splice()
D) delete()
Answer:
A) pop()
Question 329:
What will console.log(!!''); output?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 330:
Which operator is used to concatenate strings in JavaScript?
A) +
B) &
C) .
D) concat()
Answer:
A) +
Question 331:
What is the output of console.log(3 == '3');?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 332:
Which function is used to convert a string to lowercase?
A) toLowerCase()
B) lowerCase()
C) toLower()
D) lower()
Answer:
A) toLowerCase()
Question 333:
What will console.log('1' + 2 + 3); output?
A) 6
B) 123
C) 15
D) error
Answer:
B) 123
Question 334:
What will console.log([1, 2, 3].pop()); output?
A) 1
B) 3
C) undefined
D) error
Answer:
B) 3
Question 335:
What does the Math.random() function return?
A) A random integer
B) A random decimal between 0 and 1
C) A random number between 1 and 10
D) None of the above
Answer:
B) A random decimal between 0 and 1
Question 336:
Which of the following is not a valid way to check for equality?
A) ===
B) ==
C) !=
D) ==!
Answer:
D) ==!
Question 337:
Which of the following can be used as a key in an object?
A) String
B) Number
C) Symbol
D) All of the above
Answer:
D) All of the above
Question 338:
What will console.log('5' + 5 - 5); output?
A) 5
B) 10
C) 55
D) error
Answer:
A) 5
Question 339:
What is the output of console.log(null === undefined);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 340:
Which of the following is used to stop the execution of a function?
A) break
B) return
C) continue
D) stop
Answer:
B) return
Question 341:
What will console.log(typeof function(){}); output?
A) function
B) object
C) undefined
D) error
Answer:
A) function
Question 342:
Which of the following methods is used to join two or more arrays?
A) concat()
B) join()
C) merge()
D) combine()
Answer:
A) concat()
Question 343:
What is the output of console.log('a' > 'b');?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 344:
What is the output of console.log([2] == [2]);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 345:
What is the output of console.log(0 == false);?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 346:
What is the output of console.log(typeof []);?
A) array
B) object
C) undefined
D) error
Answer:
B) object
Question 347:
Which of the following is a JavaScript framework?
A) React
B) Angular
C) Vue
D) All of the above
Answer:
D) All of the above
Question 348:
What does parseInt('100.10') return?
A) 100.10
B) 100
C) undefined
D) error
Answer:
B) 100
Question 349:
What is the output of console.log(5 + '5');?
A) 10
B) 55
C) undefined
D) error
Answer:
B) 55
Question 350:
Which function is used to convert a string to lowercase?
A) toLowerCase()
B) lowerCase()
C) toLower()
D) lower()
Answer:
A) toLowerCase()
«
1
2
3
4
5
6
7
8
9
10
»
Showing 301-350 of 500 questions