Javascriptの型変換
型変換の関数も用意されていますが
こんなんでも出来るんですね
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
http://www.ideaxidea.com/archives/2010/03/javascript_type_conversion.html