All quizzesEasy
Core Concepts — Series 2
Preview — 3 of 10 questions
What is logged by the following code?
javascript
let str = "Hello";
str.toUpperCase();
console.log(str);A"HELLO"
B"Hello"
Cundefined
DTypeError: Cannot read property
What does the following code log?
javascript
const arr = [1, 2, 3, 4, 5];
arr.length = 2;
console.log(arr);A[1, 2]
B[1, 2, 3, 4, 5]
C[1, 2, undefined, undefined, undefined]
D[]
What is logged?
javascript
const a = 3, b = 4;
console.log(`Sum: ${a + b}`);ASum: ${a + b}
BSum: NaN
CSum: 7
DSyntaxError
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.