DUET PG Score Card 2021
NHAI Recruitment 2021
Bihar Board 12th Dummy Admit Card 2022
RBI Assistant Notification 2021
Jee Advanced 2021 Result
NIACL Assistant Recruitment 2021
SBI PO Online Form 2021

Pass By Value Advanced JavaScript for All

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.]

  1. 10 15
  2. 15 10 Correct
  3. 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.

Leave a Comment