+ 1

Stuck with Problem of Javascript(pls help)

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. Last problem named words in Javascript tutorial😶

25th Dec 2020, 4:22 PM
Jyoti Prasad Boro
Jyoti Prasad Boro - avatar
3 Respostas
+ 2
class Add { constructor(...word) { this.words = [...word]; } print() { console.log('
#x27;+this.words.join('
#x27;)+'
#x27;); } } const w = new Add("hello","how","are","you"); w.print(); https://code.sololearn.com/WhlQMBY1H1ev/?ref=app
26th Dec 2020, 1:43 AM
Calviղ
Calviղ - avatar
+ 1
Would've like to see your attempts
25th Dec 2020, 11:42 PM
Artur
Artur - avatar
0
Thanks Calviղ u just solved it ezzy. I'll learn again, was having difficulty with explanations a bit. You got me as a follower 🔥
26th Dec 2020, 2:06 AM
Jyoti Prasad Boro
Jyoti Prasad Boro - avatar