check if array has same values javascript

JavaScript
const allEqual = arr => arr.every(v => v === arr[0]);
allEqual([1,1,1,1]);  // true
Source

Also in JavaScript: