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

console.log('I want pizza'[0]);
Anonymous Quiz
0%
A: """
100%
B: "I"
0%
C: SyntaxError
0%
D: undefined
88. What's the output?

function sum(num1, num2 = num1) {
console.log(num1 + num2);
}

sum(10);
88. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: NaN
100%
B: 20
0%
C: ReferenceError
0%
D: undefined
89. What's the output?

// module.js
export default () => 'Hello world';
export const name = 'Lydia';

// index.js
import * as data from './module';

console.log(data);
90. What's the output?

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

const member = new Person('John');
console.log(typeof member);
90. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: "class"
0%
B: "function"
0%
C: "object"
0%
D: "string"
91. What's the output?

let newList = [1, 2, 3].push(4);

console.log(newList.push(5));
91. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: [1, 2, 3, 4, 5]
0%
B: [1, 2, 3, 5]
0%
C: [1, 2, 3, 4]
0%
D: Error
92. What's the output?

function giveLydiaPizza() {
return 'Here is pizza!';
}

const giveLydiaChocolate = () =>
"Here's chocolate... now go hit the gym already.";

console.log(giveLydiaPizza.prototype);
console.log(giveLydiaChocolate.prototype);
93. What's the output?

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

for (const [x, y] of Object.entries(person)) {
console.log(x, y);
}
94. What's the output?

function getItems(fruitList, ...args, favoriteFruit) {
return [...fruitList, ...args, favoriteFruit]
}

getItems(["banana", "apple"], "pear", "orange")
95. What's the output?

function nums(a, b) {
if (a > b) console.log('a is bigger');
else console.log('b is bigger');
return
a + b;
}

console.log(nums(4, 2));
console.log(nums(1, 2));
96. What's the output?

class Person {
constructor() {
this.name = 'Lydia';
}
}

Person = class AnotherPerson {
constructor() {
this.name = 'Sarah';
}
};

const member = new Person();
console.log(member.name);
96. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: "Lydia"
0%
B: "Sarah"
0%
C: Error: cannot redeclare Person
0%
D: SyntaxError
97. What's the output?

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

console.log(info);
console.log(Object.keys(info));