JavaScript Arrays tips and tricks with LeetCode problems