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
Web Development Training in Chandigarh
Web Development Training in Gurgaon
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 201:
What is the output of console.log(1 + 2 + '3');?
A) 6
B) 3
C) 12
D) 123
Answer:
D) 123
Question 202:
Which operator is used to assign a value to a variable?
A) =
B) ==
C) ===
D) =>
Answer:
A) =
Question 203:
What will console.log(3 + 4 + '5'); output?
A) 12
B) 35
C) 45
D) error
Answer:
B) 45
Question 204:
Which method can be used to parse a JSON string?
A) JSON.parse()
B) JSON.stringify()
C) JSON.decode()
D) JSON.convert()
Answer:
A) JSON.parse()
Question 205:
What is the output of console.log('5' + 3);?
A) 8
B) 53
C) error
D) undefined
Answer:
B) 53
Question 206:
Which of the following is a block-scoped variable declaration?
A) var
B) let
C) const
D) Both B and C
Answer:
D) Both B and C
Question 207:
What is the output of console.log(1 == '1');?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 208:
Which of the following data types is not primitive in JavaScript?
A) String
B) Number
C) Object
D) Boolean
Answer:
C) Object
Question 209:
What will console.log(typeof null); output?
A) null
B) object
C) undefined
D) error
Answer:
B) object
Question 210:
Which of the following is used to declare a constant in JavaScript?
A) var
B) let
C) const
D) constant
Answer:
C) const
Question 211:
What is the output of console.log([1, 2] == [1, 2]);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 212:
Which method is used to remove the last element from an array?
A) pop()
B) push()
C) shift()
D) unshift()
Answer:
A) pop()
Question 213:
What will console.log(2 + '2' == '22'); output?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 214:
Which of the following is not a valid way to declare a function in JavaScript?
A) function myFunc() {}
B) var myFunc = function() {}
C) let myFunc = () => {}
D) const myFunc() {}
Answer:
D) const myFunc() {}
Question 215:
What is the output of console.log(1 + '2' - 1);?
A) 2
B) 11
C) 1
D) error
Answer:
A) 2
Question 216:
Which of the following will create an array?
A) var arr = new Array();
B) var arr = [];
C) var arr = Array(5);
D) All of the above
Answer:
D) All of the above
Question 217:
What will console.log(2 * '3' + 1); output?
A) 7
B) 6
C) error
D) undefined
Answer:
A) 7
Question 218:
What is the output of console.log('1' + 2 + 3);?
A) 6
B) 123
C) 15
D) undefined
Answer:
B) 123
Question 219:
Which method can be used to find the index of an element in an array?
A) indexOf()
B) findIndex()
C) lastIndexOf()
D) All of the above
Answer:
D) All of the above
Question 220:
What is the output of console.log(0 == false);?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 221:
Which of the following is used to create a new promise?
A) Promise.create()
B) new Promise()
C) Promise.resolve()
D) Both B and C
Answer:
B) new Promise()
Question 222:
What will console.log('hello'.charAt(1)); output?
A) e
B) h
C) o
D) error
Answer:
A) e
Question 223:
Which of the following is not a valid way to create an object?
A) let obj = {};
B) let obj = new Object();
C) let obj = Object.create();
D) let obj = Object.create(null);
Answer:
C) let obj = Object.create();
Question 224:
What is the output of console.log(true + true);?
A) 1
B) 2
C) true
D) error
Answer:
B) 2
Question 225:
What does console.log([1, 2, 3].slice(1, 2)); return?
A) [2]
B) [1, 2]
C) [1, 2, 3]
D) undefined
Answer:
A) [2]
Question 226:
Which method can be used to execute a function after a specified number of milliseconds?
A) setTimeout()
B) setInterval()
C) clearTimeout()
D) requestAnimationFrame()
Answer:
A) setTimeout()
Question 227:
What is the output of console.log([1] == true);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 228:
Which operator is used to compare both value and type in JavaScript?
A) ==
B) ===
C) !=
D) !==
Answer:
B) ===
Question 229:
What is the output of console.log('5' - 3);?
A) 2
B) 53
C) error
D) undefined
Answer:
A) 2
Question 230:
What does console.log(typeof NaN); return?
A) 'number'
B) 'NaN'
C) 'undefined'
D) 'object'
Answer:
A) 'number'
Question 231:
What will console.log(typeof null); output?
A) 'null'
B) 'object'
C) 'undefined'
D) 'number'
Answer:
B) 'object'
Question 232:
Which method is used to convert a JSON string into a JavaScript object?
A) JSON.parse()
B) JSON.stringify()
C) JSON.convert()
D) JSON.object()
Answer:
A) JSON.parse()
Question 233:
Which of the following is used to check if a variable is an array?
A) Array.isArray()
B) isArray()
C) typeof
D) instanceof
Answer:
A) Array.isArray()
Question 234:
What will console.log((2 > 1) ? 'yes' : 'no'); output?
A) yes
B) no
C) undefined
D) error
Answer:
A) yes
Question 235:
Which of the following is not a JavaScript data type?
A) String
B) Number
C) Boolean
D) Character
Answer:
D) Character
Question 236:
What does console.log(1 + '1'); return?
A) 2
B) 11
C) error
D) undefined
Answer:
B) 11
Question 237:
Which of the following methods can be used to remove the last element from an array?
A) pop()
B) shift()
C) delete()
D) unshift()
Answer:
A) pop()
Question 238:
What will console.log(2 * '3'); output?
A) 6
B) '23'
C) error
D) undefined
Answer:
A) 6
Question 239:
What does console.log([1, 2, 3].concat([4, 5])); return?
A) [1, 2, 3, 4, 5]
B) [1, 2, 3, 5]
C) [1, 2, 3, [4, 5]]
D) undefined
Answer:
A) [1, 2, 3, 4, 5]
Question 240:
Which method can be used to find the largest number in an array?
A) Math.max()
B) max()
C) Math.max.apply()
D) Both A and C
Answer:
D) Both A and C
Question 241:
What is the result of the expression '5' + 3?
A) 8
B) '53'
C) '8'
D) error
Answer:
B) '53'
Question 242:
What will be the output of console.log(!!'');?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 243:
What will be the output of console.log([2] == [2]);?
A) true
B) false
C) error
D) undefined
Answer:
B) false
Question 244:
Which of the following can be used to create a new array from an existing array?
A) map()
B) filter()
C) slice()
D) All of the above
Answer:
D) All of the above
Question 245:
What does the 'this' keyword refer to in JavaScript?
A) The global object
B) The current function
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 246:
What will be the output of console.log(typeof []);?
A) 'array'
B) 'object'
C) 'undefined'
D) 'null'
Answer:
B) 'object'
Question 247:
What will be the result of console.log(0.1 + 0.2 == 0.3);?
A) true
B) false
C) error
D) undefined
Answer:
B) false
Question 248:
Which of the following methods can add elements to the end of an array?
A) push()
B) pop()
C) unshift()
D) shift()
Answer:
A) push()
Question 249:
What is the output of console.log('2' - 1);?
A) '1'
B) 1
C) '2'
D) error
Answer:
B) 1
Question 250:
What will be the output of console.log(1 == '1');?
A) true
B) false
C) error
D) undefined
Answer:
A) true
«
1
2
3
4
5
6
7
8
9
20
»
Showing 201-250 of 500 questions