About 542,000 results
Open links in new tab
  1. How do I check if a variable is an array in JavaScript?

    Apr 10, 2022 · //see if toString returns proper class attributes of objects that are arrays //returns -1 if it fails test //returns true if it passes test and it's an array //returns false if it passes test and …

  2. How to declare array of specific type in javascript

    Apr 14, 2014 · Is it possible in java script to explicitly declare array to be an array of int(or any other type)? something like var arr: Array(int) would be nice...

  3. javascript - How can I check if an object is an array? - Stack Overflow

    N.B. strings will be converted into an array with a single element instead of an array of chars. Delete the isString check if you would prefer it the other way around. I've used Array.isArray …

  4. Is there a type for an array of specific type in javascript?

    Here is what I came up with (you pass the array for the first parameter, and the type you want to check the array items against as the second parameter, it should work for most objects):

  5. javascript - Why does typeof array with objects return "object" and …

    A property name P (in the form of a String value) is an array index if and only if ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal to 2^32-1. A property whose …

  6. How come Javascript arrays can hold multiple data-types at same …

    Aug 20, 2016 · You were probably use a language with strong typing for your Data Structures course, and the definition of an array they gave you was specific for that course. It is also a …

  7. How to check if a variable is a typed array in javascript?

    That returns a useful string for all of the JavaScript built-in types ([object Array], [object Date], etc.) Per specification, Object.prototype.toString when applied to a typed array must return the …

  8. javascript - How to convert typescript types of strings to array of ...

    As of writing, the accepted answer is saying it can't be done and instead answers the other way round (array=>type). And the other answer is doing similar. In my case, this wasn't useful as I …

  9. Finding Variable Type in JavaScript - Stack Overflow

    But this will still give you the type of the value that is assigned to the variable. It will not give you the type of the variable. The question, however, explicitly asks about finding the type of the …

  10. Checking the type of an element in an array in Javascript

    Nov 1, 2017 · Just started with Javascript and am trying to check the type of an element in an array: I have a function that takes two functions as parameters. I have an array which has a …

Refresh