Javascript教程
JavaScript基础
JavaScript Objects
JavaScript BOM
JavaScript DOM
JavaScript OOP
JavaScript Cookies
JavaScript事件
JavaScript异常
JavaScript常用

TypedArray values()

JavaScript TypedArray values()方法

JavaScript values()方法用于定义数组中内容的值。

语法:

array.values()

参数:

无参数

返回值:

索引值

浏览器支持:

浏览器 版本
Chrome
Safari
Firefox
Opera

示例1

JavaScript TypedArray values()方法。
<script>
//JavaScript to illustrate types() method
 var A = new Uint8Array([ 1,3,4,5,6,7,8,9 ]);
  // Calling array.values() method
   var lidihuo = A.values();
   // Printing value of index 0
   document.write(lidihuo.next().value);
    // expected output:1
</script>
输出:
1

示例2

JavaScript TypedArray values()方法。
<script>
 //JavaScript to illustrate types() method
var A = new Uint8Array([ 1,3,4,5,6,7,8,9 ]);
   // Calling array.values() method
   var lidihuo = A.values();
// shift index to the 1
lidihuo.next();
   // Printing the value of index 1
   document.write(lidihuo.next().value);
    // expected output:3
</script>
输出:
3

示例3

JavaScript TypedArray values()方法。
<script>
 //JavaScript to illustrate types() method
 var A = new Uint8Array([ 1,3,4,5,6,7,8,9 ]);
   // Calling array.values() method
   var lidihuo = A.values();
       lidihuo.next()
       lidihuo.next()
       lidihuo.next()
       lidihuo.next()
       lidihuo.next()
       lidihuo.next()
       lidihuo.next()
       lidihuo.next()
   document.write(lidihuo.next().value);
    // expected output:undefined
</script>
输出:
undefined
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4