Last active
October 7, 2015 04:57
-
-
Save toruta39/3108810 to your computer and use it in GitHub Desktop.
Quick conversions of value types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bool = !!arg; | |
var str = arg + ""; | |
var num = arg * 1; | |
var arr = Array.prototype.slice.call(arg, 0); | |
//Str <=> Arr | |
var arr = arg.split(""); | |
var str = arg.join(""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment