+ 2
How to add spaces between array values taken from user input when displaying them?
var courses = [ ]; courses[0] = prompt("First course"); courses[1] = prompt("Second course"); courses[2] = prompt("Third course"); document.write(courses); Output=>input1,input2,input3 How can I add spaces between the three inputs when displaying them ?
3 Respostas
+ 9
console.log(courses.join(" "))
+ 5
Join the array's elements by ", "
console.log( courses.join( ", " ) );
+ 2
SAYED and Ipang Thank you guys 👍👍👍