Skip to content

Instantly share code, notes, and snippets.

@ruichuang
Last active April 10, 2017 03:08
Show Gist options
  • Select an option

  • Save ruichuang/7f5d36e7431d269d40406e477c182be7 to your computer and use it in GitHub Desktop.

Select an option

Save ruichuang/7f5d36e7431d269d40406e477c182be7 to your computer and use it in GitHub Desktop.
unary plus +
The unary plus operator precedes its operand and evaluates to its operand but attempts to convert it into a number
+3 // 3
+'3' // 3
+true // 1
+false // 0
+null // 0
+function(val){ return val } // NaN
this
3 way to call a func in ES5
func(p1, p2)
obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment