CARVIEW |
Operators and Expressions JavaScript
Operators and Expressions JavaScript
Question 1
What is the value of x after the following code is executed?
let x = 5;
x = x++ + 5;
11
10
15
6
Question 3
What will be the value of a after the following code?
let a = 10;
a -= 3;
a -= -2;
console.log(a);
5
9
7
10
Question 4
What will be the value of n after the following code?
let n = '';
n ??= 'Hello';
console.log(n);
undefined
'Hello'
null
""
Question 8
What is the value of str.length for the following string?
let str = "Hello, World!";
12
14
13
15
Question 9
What is the output of the following code?
let str = "JavaScript";
str[0] = "T";
console.log(str);
TavaScript
None of the above
Error
JavaScript
Question 10
Which of the following is a valid string interpolation syntax?
'My age is ${age}'
"My age is " + age"
`My age is ${age}`
Both B and C
There are 10 questions to complete.