executes the provided function fn once for each pair of consecutive elements of the provided array.
const array=[1,2,3,4];forEachConsPairs(array,console.log);// prints// 1 2// 2 3// 3 4 Copy
const array=[1,2,3,4];forEachConsPairs(array,console.log);// prints// 1 2// 2 3// 3 4
executes the provided function fn once for each pair of consecutive elements of the provided array.