Skip to content

Instantly share code, notes, and snippets.

@shrynx
Created October 20, 2016 02:10
Show Gist options
  • Save shrynx/8b0b4d89d737738117cd038515dce66d to your computer and use it in GitHub Desktop.
Save shrynx/8b0b4d89d737738117cd038515dce66d to your computer and use it in GitHub Desktop.
// declaring an independent variable
let a = 50
// declaring a mathematical constraint between the variable a and b
let b = a + 100
// variable b is now holding value 150
console.log(b) // 150
// manipulating value of variable a
a = 100
// variable b is still holding value 150
console.log(b) // 150
// unless we reassign the constraint between variable a and b,
// we can't have the contraint hold true.
b = a + 100
// variable b is now holding value 200
console.log(b) // 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment