JSFiddle - React, Tailwind, and code Playground
HTML
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
JavaScript
(function () {
var secundarios = [];
var ul = document.querySelector('ul');
var lis = ul.querySelectorAll('li');
[].forEach.call(lis, function (el, i) {
if (i % 2 != 0) return;
var removido = ul.removeChild(el);
secundarios.push(removido);
});
[].forEach.call(secundarios, function (el) {
ul.appendChild(el);
});
})();