mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
9 lines
263 B
JavaScript
9 lines
263 B
JavaScript
// This is ES6 spec - ArrayBuffer has its own map, and it returns the same type of array
|
|
|
|
var a = new Uint8Array([1,2,5,7,89,9,255]);
|
|
var b = a.map(function(v) { return v+1; });
|
|
var bs = b.join(",");
|
|
// note 255->0 as rolled over
|
|
|
|
result = bs=="2,3,6,8,90,10,0";
|