The Javascript Uint8ClampedArray values()
method returns an Iterator object for the values in the array.
arr.values()
Iteration using for...of loop
var arr = new Uint8ClampedArray([10, 20, 30, 40, 50]); var eArray = arr.values(); for (let n of eArray) { console.log(n);/* www .j a va 2s .c om*/ }
Alternative iteration
var arr = new Uint8ClampedArray([10, 20, 30, 40, 50]); var eArr = arr.values(); console.log(eArr.next().value); // 10 console.log(eArr.next().value); // 20 console.log(eArr.next().value); // 30 console.log(eArr.next().value); // 40 console.log(eArr.next().value); // 50