var arr = [1, 23, 1, 1, 1, 3, 23, 5, 6, 7, 9, 9, 8, 5]; Array.prototype.forEach = Array.prototype.forEach || function(callback, thisArg) { if (!callback || typeof callback !== 'function') return; for (var i = 0, j = this.length; i < j; i++) { callbac…