js中数组的字符串表示

时间:2023-12-21 17:17:32
<html>
<head>
<title>数组的字符串表示</title>
<script type="text/javascript"> function B(){
var names=["zhangsan","lisi","wangwu"]; var namestr = names.join();
alert(namestr); } </script>
</head>
<body>
<input type="text" name="name" id="name">
<input type="button" value="dian" onclick="B();"> </body>
</html>