Skip to content

Instantly share code, notes, and snippets.

@zabacad
Created September 13, 2015 04:34
Show Gist options
  • Save zabacad/42bbd11ece4e27440ebf to your computer and use it in GitHub Desktop.
Save zabacad/42bbd11ece4e27440ebf to your computer and use it in GitHub Desktop.
JS wat
> '5' - 3
2
// Weak typing + implicit conversions = headaches.
> '5' + 3
'53'
// Because we all love consistency.
> '5' - '4'
1
// String - string = integer. What?
> 'foo' + + 'foo'
'fooNan'
// Marvelous.
> '5' + - '2'
'5-2'
> '5' + - + - - + - - + + - + - + - + - - - '-2'
'52'
// Appearently it's okay.
> var x = 3;
> '5' + x - x
50
> '5' - x + x
5
// Because fuck math.
@hsq-cernansky
Copy link

WELL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment