javascript中split和整数字符串互转的用法。。。

来源:互联网 发布:在虚拟机上安装ubuntu 编辑:程序博客网 时间:2024/06/04 19:57

<script >
function evil()
{

var toint=parseInt("123");

var intvalue=123;

var tostr=intvalue.toString();


var my_friends ="trixie,moxie,sven,guido,hermes";
var friend_array =my_friends.split(",");
for (loop=0; loop < friend_array.length;loop++)
{
document.writeln(friend_array[loop] + " is myfriend.<br>");
}
}
</script>