I need some help guys | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I need some help guys

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.

5th Dec 2021, 7:08 PM
OUABI ABDESSAMAD
OUABI ABDESSAMAD - avatar
7 Answers
+ 7
OUABI ABDESSAMAD to get useful help from the community,  we need to see your attempt first. without having seen your code, it is difficult to find out where the issue is. => please put your code in playground and link it here thanks!
5th Dec 2021, 8:06 PM
Lothar
Lothar - avatar
+ 3
You must be more specific. Do you need help putting out a fire, or what?
5th Dec 2021, 7:43 PM
Brian
Brian - avatar
+ 2
Here is a hint console.log +'
#x27; this. join do some research and put the hint to use.
5th Dec 2021, 8:48 PM
Paul K Sadler
Paul K Sadler - avatar
+ 2
That is the base code, now use the hint and give it a try 😉 if you get stuck, show your try and help will come
5th Dec 2021, 8:53 PM
Paul K Sadler
Paul K Sadler - avatar
+ 2
let words = ["hello", "how", "are", "you"]; console.log('
#x27;+words.join('
#x27;)+'
#x27;); // or let s="
quot;; words.forEach(function(word) { s += `${word} ; }) console.log(s); https://code.sololearn.com/WX3q3h6a1CoV
5th Dec 2021, 10:19 PM
SoloProg
SoloProg - avatar
+ 1
This is the code 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()
5th Dec 2021, 8:52 PM
OUABI ABDESSAMAD
OUABI ABDESSAMAD - avatar
0
phtt
8th Dec 2021, 11:35 AM
Umar Sanie
Umar Sanie - avatar