2

I have searched the internet and found nothing.

This is the example of what i want:

test() {
        var a = 1;
        var b = a;
        b = 2;
        console.log(a);  //I want the output is 2 and not 1
    }

I know that objects and arrays are passed by reference and would solve the problem but i cant use that aproach.

I hope to have explained my problem well .

1
  • "i cant use that aproach [sic]" - why not? What are you actually trying to achieve with this? Commented Nov 27, 2016 at 12:36

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.