雖然知道js的類型明確指定,可是在使用中變換類型,竟然也是能夠的,例如spa
<script>ip
var a, b, c;string
a = 10;it
b = "astring";io
c = [5, 2, 4, 6];ast
a = a + 5;function
alert(a);//15變量
b = b.concat("additional words", "ending");map
alert(b);//"astringadditional wordsendingword
c = c.map(function(e){return e*2;});//10,4,8,12
alert(c);
a = b;
alert(a);//"astringadditional wordsending
b = c.length;
alert(b);//4
c = c.join("/");
alert(c);//10/4/8/12
</script>
但我以爲,知道有這個功能就能夠了,爲了節省個變量名,這麼變來變去,玩死本身,得不償失。