<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
// https://www.lawebdelprogramador.com/codigo/JavaScript/7030-Funcion-para-intercalar-los-valores-de-dos-arrays-en-uno.html
intercalarDosArrays = (a1, a2) => {
let [l, s]=a1.length > a2.length ? [a1, a2] : [a2, a1];
return Array.from({length: l.length*2}).map((_, i) => i%2==0 ? l[i/2] : s[Math.ceil(i/2)-1]).filter(el => el);
};
var lista1 = prompt("introduce primer array separando los valores por comas");
var lista2 = prompt("introduce segundo array separando los valores por comas");
l1=lista1.split(",");
l2=lista2.split(",")
if (l1.length!=l2.length) {
document.write("listas diferentes");
} else {
document.write(intercalarDosArrays(l1, l2));
}
</script>
</body>
</html>