返回到:Prototype – 数组处理
此方法生成不包含任何指定值的数组的新版本。
语法
array.without(value...);
返回值
返回一个没有指定元素的新数组。
例子
<html>
<head>
<title>Prototype examples</title>
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
<script>
function showResult() {
var arr = ['Sam', 'Justin', 'Andrew', 'Dan', 'Sam'];
alert("Without Sam : " + arr.without('Sam').inspect() );
alert("Without Dan : " + arr.without('Dan').inspect() );
}
</script>
</head>
<body>
<p>Click the button to see the result.</p>
<br />
<br />
<input type = "button" value = "Result" onclick = "showResult();"/>
</body>
</html>返回到:Prototype – 数组处理
作者:terry,如若转载,请注明出处:https://www.web176.com/prototype_api/8753.html
支付宝
微信