JavaScript中的TypedArray.subarray()函数
subarray()TypedArray对象的函数返回当前数组的一部分。它接受两个数字,分别代表子数组的开始和结束。
语法
其语法如下
typedArray.subarray(5, 9)
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var typedArray = new Int32Array([111, 56, 62, 40, 75, 36, 617, 2, 139, 827 ]);
var result = typedArray.subarray(3, 7);
document.write("Contents of the typed array: "+result);
</script>
</body>
</html>输出结果
Contents of the typed array: 40,75,36,617
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短