- 3
https://www.sololearn.com/learning/eom-project/1024/984
Please Please š help me!
3 Answers
+ 2
Ahmed Waiz What help you want?
If you are facing problem in code please attach your code with your question also write clear description.
0
1. First you have to define the function "print";
2. Create a variant to list the words as per constructor of the array;
3. Join the words with the $ symbol, using .join() array function;
4. log the joined string with $ symbols on the beginning and the end;
example:
class Add {
constructor(...words) {
this.words = words;
}
//your code goes here
print() {
var ar = this.words;
ar = ar.join("quot;);
console.log("quot; + ar + "quot;);
}
}
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();
0
<a "https://www.sololearn.com">Sololearn</a>