- 1
Nobody can answer 😱😱😱
class Add { constructor(...words) { this.words = words; } print() { var s = ""; for(let i = 0; i < this.words.length; i++) { var cur = this.words[i]; var addi = "
quot; + cur; s += addi; } console.log(s); } 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(); And i get an error : Unexpected identifier here in \/ var x = new Add(...... It the last task in JavaScript course here in this app. You can go there and see3 odpowiedzi
+ 3
You are missing curly brackets after the console.log to close the print method
+ 1
Why would you post it if nobody can answer it?
Please LINK YOUR CODE instead of pasting it into the description.
- 1
Thank you Toni , I am really sucked 🙉🙉