<pre>
<script>
function splitSet (set) {
let sub1, sub2;
do {
sub1 = [];
sub2 = [];
for(let i = 0; i < set.length; i++) {
(Math.random()<0.5? sub1 : sub2).push(set[i]);
}
} while (sub1.length == 0 || sub2.length == 0);
return [sub1, sub2];
}
for (let i = 0; i < 25; i++) {
let [s1, s2] = splitSet([1,2,3,4,5,6,7])
document.write(`[[${s1}],[${s2}]]<br>`)
}
</script>
</pre>