- 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 see

25th Oct 2022, 5:29 PM
Abubakr Shomirsaidov
3 Réponses
+ 3
You are missing curly brackets after the console.log to close the print method
25th Oct 2022, 5:44 PM
Toni Isotalo
Toni Isotalo - avatar
+ 1
Why would you post it if nobody can answer it? Please LINK YOUR CODE instead of pasting it into the description.
25th Oct 2022, 5:44 PM
Lisa
Lisa - avatar
- 1
Thank you Toni , I am really sucked 🙉🙉
25th Oct 2022, 5:47 PM
Abubakr Shomirsaidov