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 Javascript CSS MCQ Interview Questions
Question 101:
Which of the following is a primitive data type in JavaScript?
A) Array
B) Object
C) String
D) Function
Answer:
C) String
Question 102:
What will console.log(1 == '1'); output?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 103:
Which method is used to add one or more elements to the end of an array?
A) push()
B) pop()
C) shift()
D) unshift()
Answer:
A) push()
Question 104:
What will console.log('10' + 1); output?
A) 11
B) 101
C) error
D) undefined
Answer:
B) 101
Question 105:
Which of the following is used to declare a variable in JavaScript?
A) var
B) let
C) const
D) All of the above
Answer:
D) All of the above
Question 106:
What is the output of console.log(typeof null);?
A) null
B) object
C) undefined
D) error
Answer:
B) object
Question 107:
Which of the following is a method to convert a string to a number?
A) parseInt()
B) parseFloat()
C) Number()
D) All of the above
Answer:
D) All of the above
Question 108:
What does the Array.isArray() method do?
A) Checks if a variable is an array
B) Creates a new array
C) Returns the length of an array
D) None of the above
Answer:
A) Checks if a variable is an array
Question 109:
Which of the following is not a falsy value in JavaScript?
A) 0
B) ""
C) false
D) 1
Answer:
D) 1
Question 110:
What will be the output of console.log(5 === '5');?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 111:
Which of the following methods removes the last element from an array?
A) pop()
B) shift()
C) splice()
D) slice()
Answer:
A) pop()
Question 112:
What will console.log([1, 2, 3].includes(2)); output?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 113:
What is the output of console.log(Math.max(1, 2, 3));?
A) 1
B) 2
C) 3
D) undefined
Answer:
C) 3
Question 114:
Which keyword is used to create a new function in JavaScript?
A) function
B) method
C) create
D) new
Answer:
A) function
Question 115:
What does console.log(3 + 2 + '7'); output?
A) 12
B) 57
C) 27
D) error
Answer:
B) 57
Question 116:
Which method is used to remove the first element from an array?
A) pop()
B) shift()
C) slice()
D) splice()
Answer:
B) shift()
Question 117:
What is the output of console.log(!!null);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 118:
Which method can be used to iterate over an array?
A) map()
B) forEach()
C) filter()
D) All of the above
Answer:
D) All of the above
Question 119:
What will console.log('Hello'.substring(1, 4)); output?
A) Hel
B) ell
C) llo
D) Hello
Answer:
B) ell
Question 120:
Which operator is used for strict equality comparison?
A) ==
B) ===
C) !=
D) !==
Answer:
B) ===
Question 121:
What does the map() method do?
A) Transforms each element of an array
B) Filters elements based on a condition
C) Sorts an array
D) None of the above
Answer:
A) Transforms each element of an array
Question 122:
What is the output of console.log(1 + 2 + '3' - 1);?
A) 3
B) 23
C) 2
D) error
Answer:
A) 2
Question 123:
Which of the following is a way to 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 124:
What is the output of console.log('5' - 2);?
A) 3
B) 5
C) undefined
D) error
Answer:
A) 3
Question 125:
Which of the following will trigger a TypeError in JavaScript?
A) null.length
B) undefined.length
C) 1.length
D) All of the above
Answer:
D) All of the above
Question 126:
What is the output of console.log([2] == [2]);?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 127:
What is the output of console.log('abc'.charAt(1));?
A) a
B) b
C) c
D) undefined
Answer:
B) b
Question 128:
What does the JSON.stringify() method do?
A) Converts a JavaScript object to a JSON string
B) Parses a JSON string into a JavaScript object
C) Validates a JSON string
D) None of the above
Answer:
A) Converts a JavaScript object to a JSON string
Question 129:
Which method is used to add an element to the end of an array?
A) push()
B) unshift()
C) pop()
D) shift()
Answer:
A) push()
Question 130:
What is the output of console.log(!!undefined);?
A) true
B) false
C) null
D) error
Answer:
B) false
Question 131:
Which method is used to convert a JSON string into a JavaScript object?
A) JSON.parse()
B) JSON.stringify()
C) JSON.convert()
D) JSON.toObject()
Answer:
A) JSON.parse()
Question 132:
What is the output of console.log('1' + 1);?
A) 2
B) 11
C) '1'
D) error
Answer:
B) 11
Question 133:
Which keyword is used to declare a variable in JavaScript?
A) var
B) let
C) const
D) All of the above
Answer:
D) All of the above
Question 134:
What does the 'this' keyword refer to in JavaScript?
A) The global object
B) The current function context
C) The current class instance
D) None of the above
Answer:
B) The current function context
Question 135:
Which of the following is a falsy value in JavaScript?
A) 0
B) "" (empty string)
C) null
D) All of the above
Answer:
D) All of the above
Question 136:
What is the output of console.log(typeof NaN);?
A) number
B) undefined
C) object
D) error
Answer:
A) number
Question 137:
Which of the following is used to handle exceptions in JavaScript?
A) try...catch
B) throw
C) finally
D) All of the above
Answer:
D) All of the above
Question 138:
What is the output of console.log('2' + '2');?
A) 4
B) 22
C) '22'
D) error
Answer:
B) 22
Question 139:
Which function is used to remove the last element from an array?
A) pop()
B) push()
C) shift()
D) unshift()
Answer:
A) pop()
Question 140:
What does the '===' operator do in JavaScript?
A) Compares two values for equality
B) Compares two values and types for equality
C) Compares two values for inequality
D) None of the above
Answer:
B) Compares two values and types for equality
Question 141:
What is the output of console.log(1 == '1');?
A) true
B) false
C) undefined
D) error
Answer:
A) true
Question 142:
What is the output of console.log(typeof null);?
A) object
B) null
C) undefined
D) error
Answer:
A) object
Question 143:
Which of the following methods is used to convert a string to an integer?
A) parseInt()
B) parseFloat()
C) Number()
D) All of the above
Answer:
D) All of the above
Question 144:
What is the output of console.log('3' - 2);?
A) 1
B) '1'
C) NaN
D) error
Answer:
A) 1
Question 145:
Which method is used to remove the first element from an array?
A) shift()
B) pop()
C) unshift()
D) push()
Answer:
A) shift()
Question 146:
What is the output of console.log(1 === '1');?
A) true
B) false
C) undefined
D) error
Answer:
B) false
Question 147:
Which method is used to add one or more elements to the beginning of an array?
A) push()
B) pop()
C) unshift()
D) shift()
Answer:
C) unshift()
Question 148:
What is the output of console.log(2 + '2');?
A) 4
B) '22'
C) 22
D) error
Answer:
B) '22'
Question 149:
Which of the following is used to define a block scope variable in JavaScript?
A) var
B) let
C) const
D) All of the above
Answer:
D) All of the above
Question 150:
What is the output of console.log(!!'');?
A) true
B) false
C) null
D) error
Answer:
B) false
«
1
2
3
4
5
6
7
8
9
10
»
Showing 101-150 of 500 questions