81. What is the output?
function sayHi(name) {
return `Hi there, ${name}`;
}
console.log(sayHi());81. What is the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: Hi there,
100%
B: Hi there, undefined
0%
C: Hi there, null
0%
D: ReferenceError
82. What is the output?
var status = 'π';
setTimeout(() => {
const status = 'π';
const data = {
status: 'π₯',
getStatus() {
return this.status;
},
};
console.log(data.getStatus());
console.log(data.getStatus.call(this));
}, 0);
82. What is the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
50%
A: "π₯" and "π"
50%
B: "π₯" and "π"
0%
C: "π" and "π"
0%
D: "π" and "π"
83. What is the output?
const person = {
name: 'Lydia',
age: 21,
};
let city = person.city;
city = 'Amsterdam';
console.log(person);83. What is the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
50%
A: { name: "Lydia", age: 21 }
50%
B: { name: "Lydia", age: 21, city: "Amsterdam" }
0%
C: { name: "Lydia", age: 21, city: undefined }
0%
D: "Amsterdam"
84. What is the output?
function checkAge(age) {
if (age < 18) {
const message = "Sorry, you're too young.";
} else {
const message = "Yay! You're old enough!";
}
return message;
}
console.log(checkAge(21));84. What is the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: "Sorry, you're too young."
0%
B: "Yay! You're old enough!"
0%
C: ReferenceError
0%
D: undefined
85. What kind of information would get logged?
fetch('https://www.website.com/api/user/1')
.then(res => res.json())
.then(res => console.log(res));85. What kind of information would get logged?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: fetch metodining natijasi.
0%
B: fetch metodining ikkinchi marta chaqirilishidan chiqqan natija.
0%
C: Oldingi .then() ichidagi callback funksiyasining natijasi.
0%
D: Har doim undefined boβladi.
86. Which option is a way to set hasName equal to true, provided you cannot pass true as an argument?
function getName(name) {
const hasName = //
}86. Which option is a way to set hasName equal to true, provided you cannot pass true as an argument?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: !!name
100%
B: name
0%
C: new Boolean(name)
0%
D: name.length
87. What's the output?
console.log('I want pizza'[0]);
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:
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);
89. What's the output?
Javob variantlari:
Javob variantlari:
Anonymous Quiz
0%
A: { default: function default(), name: "Lydia" }
0%
B: { default: function default() }
0%
C: { default: "Hello world", name: "Lydia" }
0%
D: Global object of module.js
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:
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:
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