返回到:Prototype – 数字处理
该方法调用回调函数N次,从0开始。回调函数调用一个参数,范围从0到数字,独占。
语法
N.times(Callback Function);
返回值
封装号码。
例子
<html>
<head>
<title>Prototype examples</title>
<script type = "text/javascript" src = "/javascript/prototype.js"></script>
<script>
function showResult() {
var s = '';
(5).times(function(n) {
s += n;
});
alert("Encapsulated Number : " + s );
}
</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/8921.html
支付宝
微信