7. What's the output?
let a = 3;
let b = new Number(3);
let c = 3;
console.log(a == b);
console.log(a === b);
console.log(b === c);
7. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: true false true
0%
B: false false true
100%
C: true false false
0%
D: false true true
8. What's the output?
class Chameleon {
static colorChange(newColor) {
this.newColor = newColor;
return this.newColor;
}
constructor({ newColor = 'green' } = {}) {
this.newColor = newColor;
}
}
const freddie = new Chameleon({ newColor: 'purple' });
console.log(freddie.colorChange('orange'));8. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: orange
0%
B: purple
0%
C: green
100%
D: TypeError
9. What's the output?
let greeting;
greetign = {}; // Typo!
console.log(greetign);
9. What's the output?
Javob variantlar:
Javob variantlar:
Anonymous Quiz
0%
A: {}
0%
B: ReferenceError: greetign is not defined
0%
C: undefined
10. What happens when we do this?
function bark() {
console.log('Woof!');
}
bark.animal = 'dog';10. What happens when we do this?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: Nothing, this is totally fine!
0%
B: SyntaxError. You cannot add properties to a function this way.
0%
C: "Woof" gets logged.
0%
D: ReferenceError
11. What's the output?
function Person(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
const member = new Person('Lydia', 'Hallie');
Person.getFullName = function() {
return `${this.firstName} ${this.lastName}`;
};
console.log(member.getFullName());11. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: TypeError
0%
B: SyntaxError
0%
C: Lydia Hallie
0%
D: undefined undefined
12. What's the output?
function Person(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
const lydia = new Person('Lydia', 'Hallie');
const sarah = Person('Sarah', 'Smith');
console.log(lydia);
console.log(sarah);12. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: Person {firstName: "Lydia", lastName: "Hallie"} and undefined
0%
B:Person {firstName: "Lydia", lastName: "Hallie"} and Person {firstName: "Sarah", lastName: "Smith"}
0%
C: Person {firstName: "Lydia", lastName: "Hallie"} and {}
0%
D: Person {firstName: "Lydia", lastName: "Hallie"} and ReferenceError
13. What are the three phases of event propagation?
Anonymous Quiz
0%
A: Target > Capturing > Bubbling
0%
B: Bubbling > Target > Capturing
0%
C: Target > Bubbling > Capturing
100%
D: Capturing > Target > Bubbling
15. What's the output?
function sum(a, b) {
return a + b;
}
sum(1, '2');15. What's the output?
Javob variantlar:
Javob variantlar:
Anonymous Quiz
0%
A: NaN
0%
B: TypeError
100%
C: "12"
0%
D: 3
16. What's the output?
let number = 0;
console.log(number++);
console.log(++number);
console.log(number);
16. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: 1 1 2
0%
B: 1 2 2
100%
C: 0 2 2
0%
D: 0 1 2
17. What's the output?
function getPersonInfo(one, two, three) {
console.log(one);
console.log(two);
console.log(three);
}
const person = 'Lydia';
const age = 21;
getPersonInfo`${person} is ${age} years old`;17. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: "Lydia" 21 ["", " is ", " years old"]
100%
B: ["", " is ", " years old"] "Lydia" 21
0%
C: "Lydia" ["", " is ", " years old"] 21