<!DOCTYPE html>
<html>
<body>
<p>This "home made" function, when used on an array, returns true.</p>
<p id="demo"></p>
<script>
var fruits = ["Banana", "Orange", "Apple", "Mango"];
document.getElementById("demo").innerHTML = isArray(fruits);
function isArray(x) {
return x.constructor.toString().indexOf("Array") > -1;
}
</script>
</body>
</html>