【文件属性】:
文件名称:在JS方法中返回多个值的方法汇总
文件大小:28KB
文件格式:PDF
更新时间:2021-01-19 17:47:18
js js代码 方法
在使用JS编程中,有时需要在一个方法返回两个个或两个以上的数据,用下面的几种方法都可以实现:
1 使用数组的方式,如下:
<html>
<head>
<title>JS函数返回多个值</title>
</head>
<body>
<input type=button onclick=getNames() value=test />
[removed]
function getData()
{
var names=new Array(oec2003,oec2004);
return names;
}
funct