[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] Do Typed Array need an isArray method?




A conventional _javascript_   variable can be queried  to determine if its an array with the Array.isArray(  x )  method.
Typed Arrays don't provide an equivalent metadata query.   Should there be a method to determine whether a  Typed Array
variable is a Typed Array.  Here is a table of a properties for _javascript_ and Typed arrays.

The code to produce this table is attached.

Type Name isArray type of length element size byte length
_javascript_ Array true object 0 undefined undefined
Float64Array false object 0 8 0
Float32Array false object 0 4 0
Int32Array false object 0 4 0
Int16Array false object 0 2 0
Int8Array false object 0 1 0
ArrayBuffer false object undefined undefined 0
Title: Typed Array Tests

Table of Typed Array Properties

/* Copyright (C) Tim Child 2012 All rights reserved THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */