What will be the output of the following code snippet?
const obj1 = {first: 20, second: 30, first: 50};
console.log(obj1);
wp_js
Quiz
•
Engineering
•
University
•
Hard
Prashanthi Prashanthi
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
const obj1 = {first: 20, second: 30, first: 50};
console.log(obj1);
{first: 20, second: 30, first: 50}
{first: 50, second: 30}
{first: 20, second: 30}
syntax error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
print(typeof(NaN));
None of the above
String
Number
Object
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
const set = new Set();
set.add(5);
set.add('Hello');
set.add({ name: 'Scaler' });
for (let item of set)
{ console.log(item + 6); }
11 NaN NaN
11 Nan [object object]
11 Hello6 [object object]6
None of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
var a = true + true + true * 3; print(a)
3
0
5
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When the switch statement matches the expression with the given labels, how is the comparison done?
Only the value of the expression is compared.
None of the above.
Only the datatype of the expression is compared.
Both the datatype and the result of the expression are compared.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following keywords is used to define a variable in Javascript?
None of the above
Both A and B
let
var
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following methods can be used to display data in some form using Javascript?
All of the above
window.alert()
console.log()
document.write()
10 questions
Quiz 2
Quiz
•
University
10 questions
Keputusan dalam Pemrograman Python
Quiz
•
University
15 questions
CYBERSYNAPSE
Quiz
•
University
10 questions
Engine Fun Quiz
Quiz
•
University
10 questions
p2rt
Quiz
•
7th Grade - University
10 questions
Internal Lab Quiz-1 CSECS
Quiz
•
University
10 questions
Input & Output Interfacing Raspberry Pi Pico
Quiz
•
University
8 questions
Quiz 1: Module 1
Quiz
•
University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade