var a = 10; var b = a; a = 15; console.log(a, b);
[Try to answer it on your own. After that, check the output in the Console tab in the Developer Tools.]
- 10 15
- 15 10 Correct
- 15 15
This option is the correct choice. Notice that both the variables a and b are of primitive type – number. This is the example where the variable b is passed the value contained in the variable a. Now, when the value contained in the variable a is changed, there is no effect on the value of the variable in b. To know more, watch the video that is given in this segment.