Words project
It’s still not running can anyone give me a correct code Please i beg you Words project My code class Add { constructor(...words) { this.words = words; } //your code goes here print(){ var y =""; for(x of this.words){ y += `$${x}`; } console.log(‘$y$’); } } var x = new Add("hehe", "hoho", "haha", "hihi", "huhu"); var y = new Add("this", "is", "awesome"); var z = new Add("lorem", "ipsum", "dolor", "sit", "amet", ",", "consectetur", "adipiscing", "elit"); x.print(); y.print(); z.print();
12/17/2020 4:06:27 PM
Emmanuel Osemudiamen
30 Answers
New Answerclass Add { constructor(...words) { this.words = words; this.curWord = ""; } //your code goes here print(){ this.curWord = ""; this.words.map((el,i)=>{ this.curWord+="$"+el; }); console.log(this.curWord+"$"); } } var x = new Add("hehe", "hoho", "haha", "hihi", "huhu"); var y = new Add("this", "is", "awesome"); var z = new Add("lorem", "ipsum", "dolor", "sit", "amet", ",", "consectetur", "adipiscing", "elit"); x.print(); y.print(); z.print(); //This works for me ...read the hint that is given in the problem it will helps you alot
Zhenis Otarbay SoloLearn updated the challenge code. Now prior attempts that are based on the old code will never pass the test. I discovered that my code, which once passed, now failed. The difference is this line: Old var z = new Add("lorem", "ipsum", "dolor", "sit", "amet", ",", "consectetur", "adipiscing", "elit"); New var z = new Add("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"); They removed the "," from the z word list after "amet". If the quoted comma is in your code, then remove it.
Gabriele Gatti can you give me the correct code with an explanation , please... i tried this work below but it didn't work .... this is yours from 17 days ago ... can you help me class Add { constructor(...words) { this.words = words; this.print = print; } } function print() { var a = this.words.map((word) => "$"+word); var b = a.join(""); console.log(b+"$"); } var x = new Add("hehe", "hoho", "haha", "hihi", "huhu"); var y = new Add("this", "is", "awesome"); var z = new Add("lorem", "ipsum", " dolor", "sit", "amet", ",", "consectetur", "adipiscing", "elit"); x.print(); y.print(); z.print();
class Add { constructor(...words) { this.words = words; } //your code goes here print(){ let y="" for(x of this.words){ y=y+"$"+x; } console.log(y); } } var x = new Add("hehe", "hoho", "haha", "hihi", "huhu",""); var y = new Add("this", "is", "awesome",""); var z = new Add("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit",""); x.print(); y.print(); z.print();
Check those links https://www.sololearn.com/Discuss/2610282/?ref=app https://www.sololearn.com/Discuss/2611466/?ref=app
bro can is this the correct code var a = this.words.map((word) => "$"+word); var b = a.join(""); console.log(b+"$");?
this is what i saw <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> </body> </html>
Emmanuel Osemudiamen I have done it in such a way: https://code.sololearn.com/cbxsm9Vv106d/?ref=app
Contact manager My code isn’t running . code_ function contact(name, number) { this.name = name; this.number = number; } print() var a = new contact("David", 12345); var b = new contact("Amy", 987654321) a.print(); b.print();
please can you give me the correct code with an explanation for my contact manager project
Bishoy shnouda as already pointed out here, SoloLearn changed the code. It broke the older solutions. https://www.sololearn.com/post/838036/?ref=app
Ok Brain ... but what should i do to take my degree in JS ? this link not work https://www.sololearn.com/post/838036/?ref=app and in my code show to my tis message " this test case is hidden " told my what's problem?