0

Can anyone help me with this JavaScript Code?

const fruits=['apple','orange','graphs','cucumber',10,true]; console.log(Array.isArray('apple')); //Please explain me what this Array methods does //Array.isArray

22nd May 2021, 6:50 AM
Sandesh Adhikari
Sandesh Adhikari - avatar
6 Answers
+ 4
From https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/array/isarray "The Array.isArray() method determines whether the passed value is an Array." The method returms boolean true when the given argument was an array.
22nd May 2021, 6:54 AM
Ipang
+ 4
Visph, Didn't see you when I wrote LOL 😂
22nd May 2021, 6:59 AM
Ipang
+ 1
this (static) method check if the type of the argument is a valid array, in wich case it return true ^^
22nd May 2021, 6:54 AM
visph
visph - avatar
+ 1
22nd May 2021, 6:57 AM
visph
visph - avatar
+ 1
Ipang we wrote same thing almost as same time: didn't see your answer when posting the same link ;)
22nd May 2021, 7:01 AM
visph
visph - avatar