immutable values
let a = {
foo: 'bar'
};
let b = a;
a.foo = 'test';
console.log(b.foo); // test
console.log(a === b) // true
let a = 'test';
let b = a;
a = a.substring(2);
console.log(a) //st
console.log(b) //test
console.log(a === b) //false
let a = ['foo', 'bar'];
let b = a;
a.push('baz')
console.log(b); // ['foo', 'bar', 'baz']
console.log(a === b) // true
let a = 1;
let b = a;
a++;
console.log(a) //2
console.log(b) //1
console.log(a === b) //false
Also in JavaScript:
- nodemon.json env
- toggle class to an element javascript
- get value in maps loop using enzym
- javascript array reorder elements
- jquery validator Url
- command reboot android app react native adb command
- check if element is visible
- change favicon with javascript
- how to freeze js object
- how to sanitize request body in node js
- Unterminated quote at columns 0-8 ['MM-yyyy] in expression ['MM-yyyy]
- object find javascript
- javascript javascript javascript javascript javascript
- anime.js morph svg d value
- angularjs accordion access toggle
- es6 array sum javascript
- facebook integration in node.js
- getting the value of pi in javascript
- angular wait all subscriptions
- function takes object name and property name and new value
- change input placeholder text jquery
- host angular app on node server
- remove last element from array javascript
- cJSON_CreateObject