JS Coding Questions Logo
JS Coding Questions
#2🎯 Exercise💻 Code

JavaScript Coding Exercise 2

Advertisement

728x90
javascript
1function foo() {
2
3let x = (y = 0);
4
5x++;
6
7y++;
8
9return x;
10}
11
12console.log(foo(), typeof x, typeof y);

Choose the correct output:

A
1, undefined and undefined
B
ReferenceError: X is not defined
C
1, undefined and number
D
1, number and number

Advertisement

Responsive Ad
2of86