check array values equal js

JavaScript
[1,1,1,1].every( (val, i, arr) => val === arr[0] )   // true
Source

Also in JavaScript: