| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Float32Array | [Back] [Original] |
Get to know MDN better
new Float32Array(length); new Float32Array(typedArray); new Float32Array(object); new Float32Array(buffer [, byteOffset [, length]]);
Float32Array.BYTES_PER_ELEMENT Float32Array 4
Float32Array.prototypeTypedArray
Float32Array.from() Float32Array Array.from()
Float32Array.of() Float32Array Array.of()
Float32Array.prototype.constructor Float32Array
Float32Array.prototype.buffer Float32Array ArrayBuffer
Float32Array.prototype.byteLength Float32Array ArrayBuffer ()
Float32Array.prototype.byteOffset Float32Array ArrayBuffer
Float32Array.prototype.length Float32Array
// From a length
var float32 = new Float32Array(2);
float32[0] = 42;
console.log(float32[0]); // 42
console.log(float32.length); // 2
console.log(float32.BYTES_PER_ELEMENT); // 4
// From an array
var arr = new Float32Array([21, 31]);
console.log(arr[1]); // 31
// From another TypedArray
var x = new Float32Array([21, 31]);
var y = new Float32Array(x);
console.log(y[0]); // 21
// From an ArrayBuffer
var buffer = new ArrayBuffer(16);
var z = new Float32Array(buffer, 0, 4);
| ECMAScript 2027 LanguageSpecification # sec-typedarray-objects |
ECMAScript 2015 (ES6) Float32ArraynewFloat32Array newTypeError
var dv = Float32Array([1, 2, 3]);
// TypeError: calling a builtin Float32Array constructor
// new
var dv = new Float32Array([1, 2, 3]);
Float32ArrayTypedArrayat()TypedArray.prototype.copyWithin()TypedArray.prototype.entries()TypedArray.prototype.every()TypedArray.prototype.fill()TypedArray.prototype.filter()TypedArray.prototype.find()TypedArray.prototype.findIndex()findLast()findLastIndex()TypedArray.prototype.forEach()TypedArray.prototype.includes()TypedArray.prototype.indexOf()TypedArray.prototype.join()TypedArray.prototype.keys()TypedArray.prototype.lastIndexOf()TypedArray.prototype.map()TypedArray.prototype.reduce()TypedArray.prototype.reduceRight()TypedArray.prototype.reverse()set()slice()TypedArray.prototype.some()TypedArray.prototype.sort()TypedArray.prototype.subarray()TypedArray.prototype.toLocaleString()toReversed()TypedArray.prototype.toSorted()toString()TypedArray.prototype.values()TypedArray.prototype.with()TypedArray.prototype[Symbol.iterator]()Object/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()BigInt64ArrayBigUint64ArrayFloat16ArrayFloat64ArrayInt8ArrayInt16ArrayInt32ArrayUint8ArrayUint8ClampedArrayUint16ArrayUint32Array| Web Proxy Viewer | New URL | Original Page |