Check The Constructor Property To Find Out If An Object

[Solved] Check The Constructor Property To Find Out If An Object | Solidity - Code Explorer | yomemimo.com
Question : check the constructor property to find out if an object is an Array (contains the word "Array"):

Answered by : envious-echidna-7buf6pz36kow

function isArray(myArray) {
    return myArray.constructor.toString().indexOf("Array") > -1;
}

Source : http://www-db.deis.unibo.it/courses/TW/DOCS/w3schools/js/js_type_conversion.asp.html | Last Update : Wed, 07 Jul 21

Answers related to check the constructor property to find out if an object is an array contains the word

Code Explorer Popular Question For Solidity