Thanks for reading my post. I will admit that the const reverseArrayInPlace = (array) => {, the first line was missing the = sign. But it is otherwise working for me. Even with even number of elements. Very curious about your finding. Could you please share the code if interested? :)
regarding "Reversing an array in place", this is not working when there are even number of elements.
for (let i = 0; i <= Math.floor((array.length / 2)-1); i++)
adding -1 is necessary here.
Hi @steffi,
Thanks for reading my post. I will admit that the
const reverseArrayInPlace = (array) => {
, the first line was missing the=
sign. But it is otherwise working for me. Even with even number of elements. Very curious about your finding. Could you please share the code if interested? :)