59. What's the output?
const numbers = [1, 2, 3, 4, 5];
const [y] = numbers;
console.log(y);
59. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: [[1, 2, 3, 4, 5]]
0%
B: [1, 2, 3, 4, 5]
100%
C: 1
0%
D: [1]
60. What's the output?
const user = { name: 'Lydia', age: 21 };
const admin = { admin: true, ...user };
console.log(admin);60. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: { admin: true, user: { name: "Lydia", age: 21 } }
100%
B: { admin: true, name: "Lydia", age: 21 }
0%
C: { admin: true, user: ["Lydia", 21] }
0%
D: { admin: true }
61. What's the output?
const person = { name: 'Lydia' };
Object.defineProperty(person, 'age', { value: 21 });
console.log(person);
console.log(Object.keys(person));61. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: { name: "Lydia", age: 21 }, ["name", "age"]
100%
B: { name: "Lydia", age: 21 }, ["name"]
0%
C: { name: "Lydia"}, ["name", "age"]
0%
D: { name: "Lydia"}, ["age"]
62. What's the output?
const settings = {
username: 'lydiahallie',
level: 19,
health: 90,
};
const data = JSON.stringify(settings, ['level', 'health']);
console.log(data);62. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: "{"level":19, "health":90}"
0%
B: "{"username": "lydiahallie"}"
0%
C: "["level", "health"]"
0%
D: "{"username": "lydiahallie", "level":19, "health":90}"
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:
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);64. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: 20, 40, 80, 160
0%
B: 20, 40, 20, 40
100%
C: 20, 20, 20, 40
0%
D: NaN, NaN, 20, 40
65. What's the output?
[1, 2, 3, 4].reduce((x, y) => console.log(x, y));
[1, 2, 3, 4].reduce((x, y) => console.log(x, y));
Anonymous Quiz
0%
A: 1 2 and 3 3 and 6 4
0%
B: 1 2 and 2 3 and 3 4
0%
C: 1 undefined and 2 undefined and 3 undefined and 4 undefined
100%
D: 1 2 and undefined 3 and undefined 4
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:
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;
67. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: running index.js, running sum.js, 3
100%
B: running sum.js, running index.js, 3
0%
C: running sum.js, 3, running index.js
0%
D: running index.js, undefined, running sum.js
68. What's the output?
console.log(Number(2) === Number(2));
console.log(Boolean(false) === Boolean(false));
console.log(Symbol('foo') === Symbol('foo'));
68. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
100%
A: true, true, false
0%
B: false, true, false
0%
C: true, false, true
0%
D: true, true, true
69. What's the output?
const name = 'Lydia Hallie';
console.log(name.padStart(13));
console.log(name.padStart(2));