martin ↑ pfp
martin ↑
@martin
just learned typescript passes object by reference not value unlock
2 replies
0 recast
11 reactions

nishu pfp
nishu
@nishu
since javascript πŸ˜…
1 reply
0 recast
1 reaction

martin ↑ pfp
martin ↑
@martin
Yeah I guess it’s a JavaScript thing Just had no idea for some reason, assumed it was all by value not reference
2 replies
0 recast
1 reaction

nishu pfp
nishu
@nishu
yeah its probably the only language that does this an example for those who read this let a,b; a = 10 b = a b = b + 1 console.log(a) will return 11 πŸ™ƒ (no smiley) this will get really annoying when you start dealing with arrays so [...arr] to copy contents is better
0 reply
0 recast
0 reaction