0
Words project in javascript.
class Add { constructor(...words) { this.words = words; } //your code goes here print(){ console.log('
#x27;+this.words.join('#x27;)+'#x27;) } } 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 Odpowiedź
+ 2
U can doo so
class Add {
constructor(...words) {
this.words = words;
}
//your code goes here
print(){
var wrd = ""
this.words.forEach(u => {
wrd += "quot;+u;
});
wrd += "quot;;
console.log(wrd)
}
}
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();