immutablility
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
var str = 'Hello'; // 'Hello'의 메모리 주소
str = 'world'; // 'Hello 메모리 주소 값을 수정하는게 아닌, 새로운 문자열 'world'를 가리키도록 변경.var arr = [];
arr.push(2);var user1 = {
name: 'Lee',
address: {
city: 'seoul'
}
};
var user2 = user1;
user2.name = 'Kim';
console.log(user1.name); // Kim