Where am I missing the input code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Where am I missing the input code?

function contact(name, number) { this.name = name; this.number = number; var a = new contact("David", 12345); var b = new contact("Amy", 987654321); var print1 = new print(name,number);console.log(contact.name + ': ' + contact.number); function Print(name, number){ this.name = name; this.number = number; var a = new contact ("David", 12345); var b = new contact ("Amy", 987654321); a.print(name, number); b.print(name, number);} } The expected output should be: David: 12345 Amy: 987654321 I have tried everything and written the code as the lesson said. It tells me that everything is defined, but that I am giving no input, so there is no output.

18th Nov 2022, 8:22 PM
paige embry
paige embry - avatar
1 Answer
+ 1
Calling self function without stop condition makes it infinite loop of recursion calls. You are calling concat () within concat () function. Again print () function calling concat () function, and concat () is calling print () function.. it's a dead lock.. What is your task here? Add description pls...
19th Nov 2022, 8:50 AM
Jayakrishna 🇮🇳