★ wanayoo — archive 1999 https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/lengthNouvelle recherche | Portail wanayoo

Join MDN & developers like you at Mozilla's View Source conference, November 2-4 in Portland, Oregon. Learn more at https://viewsourceconf.org/.

TypedArray.prototype.length

by 1 contributor:

This article is in need of an editorial review.

This translation is incomplete. Please help translate this article from English.

概要

typed arrayの(要素の)長さを表します。

構文

typedarray.length

説明

lengthプロパティはsetアクセスプロパティがundefinedであるアクセスプロパティです。これは、このプロパティが読み込み専用であることを意味します。その値は、TypedArrayが構築され時設定され変更されません。TypedArraybyteOffsetまたはlengthを指定していない場合、 参照されるArrayBufferの長さが返されます。TypedArrayTypedArray objectsの一つです。

lengthプロパティを使う

var buffer = new ArrayBuffer(8);

var uint8 = new Uint8Array(buffer);
uint8.length; // 8 (matches the length of the buffer)

var uint8 = new Uint8Array(buffer, 1, 5);
uint8.length; // 5 (as specified when constructing the Uint8Array)

var uint8 = new Uint8Array(buffer, 2);
uint8.length; // 6 (due to the offset of the constructed Uint8Array)

仕様

仕様 状況 コメント
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'TypedArray.prototype.length' in that specification.
Standard 初期定義。

ブラウザ実装状況

機能 Chrome Firefox (Gecko) Internet Explorer Opera Safari
基本サポート 7.0 4.0 (2) 10 11.6 5.1
機能 Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
基本サポート 4.0 (有) 4.0 (2) 10 11.6 4.2

関連情報

ドキュメントのタグと貢献者

Contributors to this page: shide55
最終更新者: shide55,
サイドバーを隠す