Skip to content

Instantly share code, notes, and snippets.

@mr-pascal
Last active February 15, 2021 10:37
Show Gist options
  • Save mr-pascal/18605d08413e733654ee97212323241b to your computer and use it in GitHub Desktop.
Save mr-pascal/18605d08413e733654ee97212323241b to your computer and use it in GitHub Desktop.
// Numbers
(() => {
let a = 5;
let b = a;
a = 6;
console.log(`-- Number --`);
console.log(`a: ${a}`); // a: 6
console.log(`b: ${b}`); // b: 5
console.log(`\n`);
})();
// Strings
(() => {
let a = 'Hello';
let b = a;
a = 'HELLO';
console.log(`-- String --`);
console.log(`a: ${a}`); // a: HELLO
console.log(`b: ${b}`); // b: Hello
console.log(`\n`);
})();
// Booleans
(() => {
let a = true;
let b = a;
a = false;
console.log(`-- Boolean --`);
console.log(`a: ${a}`); // a: false
console.log(`b: ${b}`); // b: true
console.log(`\n`);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment