Let's say I have two different arrays:
const a = ['a', 'b', 'c', 'd', 'e', 'f'];
and
const b = ['g', 'h', 'i', 'j', 'k', 'l'];
and I want to place 'c' on the position of 'l' and vice-versa, like so:
const a = ['a', 'b', 'l', 'd', 'e', 'f'];
const b = ['g', 'h', 'i', 'j', 'k', 'c'];
How can I achieve this?
I do it like this because I'm organizing a set of values in pages, and each page contains at max 6 elements