He intentado esto, pero no me funciona
![Neurótico](http://static.forosdelweb.com/fdwtheme/images/smilies/scared.png)
Código JavaScript:
Ver original
function setValues(){ var title = prompt("Title:"); var title2 = prompt("2nd title:"); return [title,title2]; } var [t,t2] = setValues(); alert("1st title: "+t+";2nd title: "+t2);
También he probado de esta forma, pero sólo me devuelve el segundo valor (title2) y el primero me lo asigna como undefined:
Código JavaScript:
Ver original
function setValues(){ var title = prompt("Title:"); var title2 = prompt("2nd title:"); return title,title2; } var t,t2 = setValues(); alert("1st title: "+t+";2nd title: "+t2);