const myPromise = () => Promise.resolve('I have resolved!');
function firstFunction() {
myPromise().then(res => console.log(res));
console.log('second');
}
async function secondFunction() {
console.log(await myPromise());
console.log('second');
}
firstFunction();
secondFunction();

JS Quiz 2 SECE

Quiz
•
Other
•
Professional Development
•
Hard
Vengatesh vengatesh
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
I have resolved!
,second
andI have resolved!
,second
second
, I have resolved!
and second
, I have resolved!
I have resolved!
, second
and second
, I have resolved!
second
, I have resolved!
and I have resolved!
, second
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is it's value?
Promise.resolve(5);
5
Promise {<pending>: 5}
Promise {<resolved>: 5}
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
const colorConfig = {
red: true,
blue: false,
green: true,
black: true,
yellow: false,
};
const colors = ['pink', 'red', 'blue'];
console.log(colorConfig.colors[1]);
true
false
undefined
TypeError
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
let name = 'Lydia';
function getName() {
console.log(name);
let name = 'Sarah';
}
getName();
Lydia
Sarah
undefined
ReferenceError
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
let config = {
alert: setInterval(() => {
console.log('Alert!');
}, 1000),
};
config = null;
The setInterval
callback won't be invoked
The setInterval
callback gets invoked once
The setInterval
callback will still be called every second
We never invoked config.alert()
, config is null
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
const name = 'Lydia Hallie';
console.log(!typeof name === 'object');
console.log(!typeof name === 'string');
false true
true false
true true
false false
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
var p = new Promise((resolve, reject) => {
return Promise.reject(Error('The Fails!'))
})
p.catch(error => console.log(error.message))
p.catch(error => console.log(error.message))
print message once
print message twice
UnhandledPromiseRejectionWarning
process exits
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
AWS Quiz Show 2023 Season 2 (Week 2)

Quiz
•
Professional Development
15 questions
Quiz Lunes

Quiz
•
Professional Development
15 questions
Petugas Pengambil Contoh Uji Air

Quiz
•
Professional Development
10 questions
String Methods

Quiz
•
Professional Development
10 questions
Pop Quiz 1 - 2024

Quiz
•
Professional Development
10 questions
Python Basics

Quiz
•
Professional Development
12 questions
QA Knowledge test

Quiz
•
Professional Development
11 questions
functions

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade