+ 2

Can you help me?

You are making a text encryptor. It should take multiple words and output a combined version, where each word is separated by a dollar sign $. For example, for the words "hello", "how", "are", "you", the output should be "$hello$how$are$you

quot;. The given code declares a class named Add, with a constructor that takes one rest parameter. Complete the code by adding a print() method to the class, which should generate the requested output. class Add { constructor(...words) { this.words = words; } //your code goes here } 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();

30th Mar 2022, 6:58 AM
Ahmedov Sirojiddin đŸ‡ș🇿
Ahmedov Sirojiddin đŸ‡ș🇿 - avatar
3 Answers
30th Mar 2022, 7:13 AM
JaScript
JaScript - avatar
+ 1
Up
30th Mar 2022, 7:10 AM
Ahmedov Sirojiddin đŸ‡ș🇿
Ahmedov Sirojiddin đŸ‡ș🇿 - avatar
+ 1
Thanks
30th Mar 2022, 7:28 AM
Ahmedov Sirojiddin đŸ‡ș🇿
Ahmedov Sirojiddin đŸ‡ș🇿 - avatar