Daily JavaScript
15 subscribers
1 photo
1 link
Daily examples, coding challenges, and useful tips for developers.
Download Telegram
4. What's the output?

+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,
};
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:
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);
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:
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:
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';
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:
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);
14. All object have prototypes.
Anonymous Quiz
0%
A: true
100%
B: false
15. What's the output?

function sum(a, b) {
return a + b;
}

sum(1, '2');