問題:
I need to find arrays where all values are equal.我需要找到所有值都相等的數組。 What's the fastest way to do this?這樣做的最快方法是什麼? Should I loop through it and just compare values?我應該遍歷它並只比較值嗎?
['a', 'a', 'a', 'a'] // true
['a', 'a', 'b', 'a'] // false
解決方案:
參考一: https://stackoom.com/question/10EdX參考二: Check if all values of array are equal