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

const info = {
[Symbol('a')]: 'b',
};

console.log(info);
console.log(Object.keys(info));
98. What's the output?

const getList = ([x, ...y]) => [x, y]
const getUser = user => { name: user.name, age: user.age }

const list = [1, 2, 3, 4]
const user = { name: "Lydia", age: 21 }

console.log(getList(list))
console.log(getUser(user))
99. What's the output?

const name = 'Lydia';

console.log(name());
99. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: SyntaxError
0%
B: ReferenceError
0%
C: TypeError
0%
D: undefined
100. What's the value of output?

// 🎉 This is my 100th question! 🎉

const output = `${[] && 'Im'}possible!
You should${'' && `n't`} see a therapist after so much JavaScript lol`;
111. What's the output?

let name = 'Lydia';

function getName() {
console.log(name);
let name = 'Sarah';
}

getName();
111. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: Lydia
0%
B: Sarah
0%
C: undefined
0%
D: ReferenceError
112. What's the output?

function* generatorOne() {
yield ['a', 'b', 'c'];
}

function* generatorTwo() {
yield* ['a', 'b', 'c'];
}

const one = generatorOne();
const two = generatorTwo();

console.log(one.next().value);
console.log(two.next().value);
113. What's the output?

console.log(`${(x => x)('I love')} to program`);
Anonymous Quiz
0%
A: I love to program
0%
B: undefined to program
0%
C: ${(x => x)('I love') to program
0%
D: TypeError
114. What will happen?

let config = {
alert: setInterval(() => {
console.log('Alert!');
}, 1000),
};

config = null;
115. Which method(s) will return the value 'Hello world!'?

const myMap = new Map();
const myFunc = () => 'greeting';

myMap.set(myFunc, 'Hello world!');

//1
myMap.get('greeting');
//2
myMap.get(myFunc);
//3
myMap.get(() => 'greeting');
115. Which method(s) will return the value 'Hello world!'?

Javob variantlari:
Anonymous Quiz
0%
A: 1
0%
B: 2
0%
C: 2 and 3
0%
D: All of them
116. What's the output?

const person = {
name: 'Lydia',
age: 21,
};

const changeAge = (x = { ...person }) => (x.age += 1);
const changeAgeAndName = (x = { ...person }) => {
x.age += 1;
x.name = 'Sarah';
};

changeAge(person);
changeAgeAndName();

console.log(person);
117. Which of the following options will return 6?

function sumValues(x, y, z) {
return x + y + z;
}
117. Which of the following options will return 6?

Javob variantlari:
Anonymous Quiz
0%
A: sumValues([...1, 2, 3])
0%
B: sumValues([...[1, 2, 3]])
0%
C: sumValues(...[1, 2, 3])
0%
D: sumValues([1, 2, 3])