0

Help for the last ejercise of the course of javascript

This is mi code and I don't understand why this do not work? Please help: class Add { constructor(...words) { this.words = words; } //tu cĂłdigo va aquĂ­ print(){ var p=""; for (let i=0;i<this.words.length ;i++){ p = p + "

quot; + this.words[i]; } let r=p+"
quot;; console.log(r); /*var l = new Array (); for (let i in this.words) { l.push("
quot;+this.words[i]); } let m = (l.join('')); let n = m+"
quot;; console.log(n);*/ } } 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();

26th Dec 2020, 5:51 AM
Jorge Federico Rivera Gallegos
Jorge Federico Rivera Gallegos - avatar
2 Answers
+ 1
Many people are having this problem. See my post for the explanation. https://www.sololearn.com/post/838036/?ref=app
26th Dec 2020, 11:43 AM
Brian
Brian - avatar
0
Yes, thanks for your help, I could complete the challenge 😀😂😂
26th Dec 2020, 2:20 PM
Jorge Federico Rivera Gallegos
Jorge Federico Rivera Gallegos - avatar