JSchallenger

Check if all array elements are equal

Viewed: 434
Attempted: 343
Solved: 121
// Write a function that takes an array as argument
// It should return true if all elements in the array are equal
// It should return false otherwise
//

function myFunction() {

return
}
Test Cases:
myFunction([true, true, true, true])
Expected
true
myFunction(['test', 'test', 'test'])
Expected
true
myFunction([1,1,1,2])
Expected
false
myFunction(['10',10,10,10])
Expected
false