NODE
node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Add {
constructor(...words) {
this.words = words;
}
//your code goes here
print (){
var w=[];
var a = [];
for (var i=0;i<this.words.length;i++){
w[i] = '$' + this.words[i];
a += w[i];
}
console.log(a + '$');
}
}
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();
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run