var contacts = {
name:["John", "Jane"],
surname:["Smith", "Doe"]
}
var list=[];
var showContact="";
var manager = prompt("Welcome to your contacts manager!\nEnter a number
for:\n1: List contacts\n2: Add a contact\n0: Exit");
if (manager = "1") {
for (i=0; i<contacts.name[i].length && i<contacts.surname[i].length; i++){
showContact = console.log(contacts.name[i] + " " + contacts.surname[i]);
list[i]= showContact;
}
}
console.log(list.length);
First of all sorry if the formatting of the code is wrong, this is my first post. Probably this is a stupid question, but I would like to understand what is happening here. Why is the length not printed on the console?.
Thank you