class Add {
constructor(...words) {
this.words = words;
}
//ваш код
print (){
let result = "$";
for (let w of this.words) {
result += w + "$"
}
}
}
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();