Hello everyone,
I have a humble question to ask.
Problem: function isArray(value) return boolean of whether argument is an Array object or not
function isArray(value) {
return (value.length >= 0 && typeof(value) == ‘object’);
}
This is my way, and it works since isArray([‘a’, ‘b’, ‘c’] return true and isArray(5) return false
and this is another solution, and I am not clear on this
function isArray(value) {
return Boolean(value.reduce);
}
I would like to know what value.reduce will return. Could anyone please help me out this question? Thanks