Skip to content

Instantly share code, notes, and snippets.

@kcjpop
Created December 21, 2013 13:34
Show Gist options
  • Save kcjpop/8069380 to your computer and use it in GitHub Desktop.
Save kcjpop/8069380 to your computer and use it in GitHub Desktop.
Some small JS tests
1. ++Math.PI
2. (0.1 + 0.2) + 0.3 == 0.1 + (0.2 + 0.3)
3. typeof NaN
4. typeof typeof undefined
5. a = {null:null}; typeof a.null;
6. a = "5"; b = "2"; c = a * b;
7. a = "5"; b = 2; c = a+++b;
8. isNaN(1/null)
9. (16).toString(16)
10. 016 * 2
11. ~null
12. "ab c".match(/\b\w\b/)
1. 4.141592653589793
2. false
3. "number"
4. "string"
5. "object"
6. 10
7. 7
8. false
9. "10"
10. 28
11. -1
12. [ "c" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment