9. What is assignment in programming?
Anonymous Quiz
67%
A) Giving a value to a variable
33%
B) Changing a loop
0%
C) Deleting a function
10. What is the main difference between map() and forEach()?
Anonymous Quiz
100%
A) map creates a new array, forEach doesn’t
0%
B) forEach runs faster than map
0%
C) map deletes the array
1. What's the output?
function sayHi() { console.log(name); console.log(age); var name = 'Lydia'; let age = 21; } sayHi();
function sayHi() { console.log(name); console.log(age); var name = 'Lydia'; let age = 21; } sayHi();
Anonymous Quiz
0%
A: Lydia and undefined
0%
B: Lydia and ReferenceError
0%
C: ReferenceError and 21
100%
D: undefined and ReferenceError
2. What's the output?
for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 1); } for (let i = 0; i < 3; i++) { setTimeout(() => console.log(i), 1); }
for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 1); } for (let i = 0; i < 3; i++) { setTimeout(() => console.log(i), 1); }
Anonymous Quiz
50%
A: 0 1 2 and 0 1 2
0%
B: 0 1 2 and 3 3 3
50%
C: 3 3 3 and 0 1 2
3. What's the output?
const shape = { radius: 10, diameter() { return this.radius * 2; }, perimeter: () => 2 * Math.PI * this.radius, }; console.log(shape.diameter()); console.log(shape.perimeter());
const shape = { radius: 10, diameter() { return this.radius * 2; }, perimeter: () => 2 * Math.PI * this.radius, }; console.log(shape.diameter()); console.log(shape.perimeter());
Anonymous Quiz
50%
A: 20 and 62.83185307179586
50%
B: 20 and NaN
0%
C: 20 and 63
0%
D: NaN and 63
4. What's the output?
+true; !'Lydia';
+true; !'Lydia';
Anonymous Quiz
100%
A: 1 and false
0%
B: false and NaN
0%
C: false and false
5. Which one is true?
const bird = {
size: 'small',
};
const mouse = {
name: 'Mickey',
small: true,
};5. Which one is true?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: mouse.bird.size is not valid
0%
B: mouse[bird.size] is not valid
0%
C: mouse[bird["size"]] is not valid
0%
C: mouse[bird["size"]] is not valid
6. What's the output?
let c = { greeting: 'Hey!' };
let d;
d = c;
c.greeting = 'Hello';
console.log(d.greeting);6. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: Hello
0%
B: Hey!
0%
C: undefined
0%
D: ReferenceError
0%
E: TypeError
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