<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
const array = [];
const LENGTH = 100; // 100, 1000, 10000, 100000
for (let i = 0; i < LENGTH; i++) array.push(i - LENGTH / 2);
let result = 0;
result += Math.max(...array);
result += _.max(array);
console.log(result);