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

const settings = {
username: 'lydiahallie',
level: 19,
health: 90,
};

const data = JSON.stringify(settings, ['level', 'health']);
console.log(data);
63. What's the output?

let num = 10;

const increaseNumber = () => num++;
const increasePassedNumber = number => number++;

const num1 = increaseNumber();
const num2 = increasePassedNumber(num1);

console.log(num1);
console.log(num2);
63. What's the output?

Javob variantlari:
Anonymous Quiz
100%
A: 10, 10
0%
B: 10, 11
0%
C: 11, 11
0%
D: 11, 12
64. What's the output?

const value = { number: 10 };

const multiply = (x = { ...value }) => {
console.log((x.number *= 2));
};

multiply();
multiply();
multiply(value);
multiply(value);
66. With which constructor can we successfully extend the Dog class?

class Dog {
constructor(name) {
this.name = name;
}
};

class Labrador extends Dog {
// 1
constructor(name, size) {
this.size = size;
}
// 2
constructor(name, size) {
super(name);
this.size = size;
}
// 3
constructor(size) {
super(name);
this.size = size;
}
// 4
constructor(name, size) {
this.name = name;
this.size = size;
}

};
66. With which constructor can we successfully extend the Dog class?

Javob variantlari:
Anonymous Quiz
0%
A: 1
100%
B: 2
0%
C: 3
0%
D: 4
67. What's the output?

// index.js
console.log('running index.js');
import { sum } from './sum.js';
console.log(sum(1, 2));

// sum.js
console.log('running sum.js');
export const sum = (a, b) => a + b;
68. What's the output?

console.log(Number(2) === Number(2));
console.log(Boolean(false) === Boolean(false));
console.log(Symbol('foo') === Symbol('foo'));
69. What's the output?

const name = 'Lydia Hallie';
console.log(name.padStart(13));
console.log(name.padStart(2));
70. What's the output?

console.log('🥑' + '💻');
Anonymous Quiz
50%
A: "🥑💻"
0%
B: 257548
50%
C: A string containing their code points
0%
D: Error
71. How can we log the values that are commented out after the console.log statement?

function* startGame() {
const answer = yield 'Do you love JavaScript?';
if (answer !== 'Yes') {
return "Oh wow... Guess we're done here";
}
return 'JavaScript loves you back ❤️';
}

const game = startGame();
console.log(/* 1 */); // Do you love JavaScript?
console.log(/* 2 */); // JavaScript loves you back ❤️
71. How can we log the values that are commented out after the console.log statement?

Javob variantlari:
Anonymous Quiz
50%
A: game.next("Yes").value and game.next().value
0%
B: game.next.value("Yes") and game.next.value()
50%
C: game.next().value and game.next("Yes").value
0%
D: game.next.value() and game.next.value("Yes")
72. What's the output?

console.log(String.raw`Hello\nworld`); ⬇️ - bu belgi pastki qatorda degani
Anonymous Quiz
0%
A: Hello world!
0%
B: Hello⬇️ world
100%
C: Hello\nworld
0%
D: Hello\n⬇️ world