View question

Why these lines of code is behaving differently? - Nodejs

Why these lines of code is behaving differently? - Nodejs.

var ab=5; function a(ab) { ab=8 }; a(ab); console.log(ab);


var x={ab:5}; function a(x){ x.ab=8 }; a(x); console.log(x);




Asked On2021-09-14 03:07:47 by:sharma

Taged users:


Likes:
Be first to like this question

Dislikes:
Be first to dislike this question
  Like  Dislike

Comments


Type your comment here