+ 2
What's wrong here?
class Add { constructor(...words) { this.words = words; } //your code goes here print(){ for(let i of this.words){ this.str += "
quot;+i; } console.log(this.str+"quot;); } } 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();1 Answer
0
Save code and share link here.. That's helps to debug code for errors if any...
edit:
Bezu Tadesse
this.str += "quot;+i;
before this this.str is undefined.
declare it before you using ....