@ManavMisra/

Reference vs Value

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const player = {
  name: 'Albert Pujols',
  number: 5,
  team: 'Cardinals'
}

const p = player;
p.team = 'Angels';

console.log(player.team);

const x = 3;
let y = x;
y = 4;

console.log(x);
node v10.16.0