Why does `IsSorted` in the standard library iterate over the slice in reverse?

Advertisements Out of curiosity, I’ve been looking at the source of both the sort package in the standard library and the experimental slices package which is soon to be added to the standard library. Both packages define an IsSorted function, where they check whether a list is sorted by verifying adjacent elements are ordered. However,… Read More Why does `IsSorted` in the standard library iterate over the slice in reverse?

Which method should I do if I want to loop through an object with 100000 elements in Javascript?

Advertisements Let’s say I have a big data array filled with numbers. Like 100 000 of them. Which is the best way to "loop through" the entire object? I’ve been reading about multithreading, web workers and so on. Also if I should use .reduce instead of for-loops with bigger data. Is those the best ways… Read More Which method should I do if I want to loop through an object with 100000 elements in Javascript?