Xlune::Tumblr
2010.03.04
19:48
var myVar = “3.14159”, str = “”+ myVar,// to string int = ~~myVar, // to integer float = 1*myVar, // to float bool = !!myVar, /* to boolean - any string with length and any number except 0 are true */ array = [myVar]; // to array
- JavaScriptの型変換ってこうやるんだ・・・ - IDEA*IDEA ~ 百式管理人のライフハックブログ
Page 1 of 1