Analyze the code snippet:
let n = 10; let m = ++n;
Its execution will result in the following values in the variables n
and m
:
- n:
11
, m:10
- n:
10
, m:11
- n:
11
, m:11
- n:
10
, m:10
Answers Explanation & Hints:
The execution of the code snippet
Let’s break down the code snippet step by step:
After the code snippet is executed, To illustrate this in code: let n = 10; let m = ++n; console.log(n); // Output: 11 console.log(m); // Output: 11 So, the resulting values in the variables |