[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map [Back]  [Original]

TypedArray.prototype.map() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

TypedArray.prototype.map()

Baseline

20169

map() TypedArray Array.prototype.map()

const uint8 = new Uint8Array([25, 36, 49]);
const roots = uint8.map(Math.sqrt);

console.log(roots);
// : Uint8Array [5, 6, 7]

js
map(callbackFn)
map(callbackFn, thisArg)

callbackFn

element

index

array

map()

thisArg

callbackFn this

Array.prototype.map()

js
const numbers = new Uint8Array([1, 4, 9]);
const roots = numbers.map(Math.sqrt);
// roots  [1, 2, 3] 
// numbers  [1, 4, 9] 

1 map() map()

js
const numbers = new Uint8Array([1, 4, 9]);
const doubles = numbers.map((num) => num * 2);
// doubles  Uint8Array [2, 8, 18] 
// numbers  Uint8Array [1, 4, 9] 

ECMAScript 2027 LanguageSpecification
# sec-%typedarray%.prototype.map


Web Proxy Viewer  |  New URL  |  Original Page