Each sibling for next.
npm install -S @jswork/next-each-sibling
import '@jswork/next-each-sibling';
const indexes = [4, 8, 12];
const res = [];
nx.eachSibling(indexes, (cur, next) => {
res.push([cur, next]);
});
// result
[
[4, 8],
[8, 12]
];
Code released under the MIT license.