- 1
My solution to words problem is not getting accepted by sololearn test case. What's wrong with what I wrote?
10 Réponses
+ 3
var a = this.words.map((word) => "quot;+word);
var b = a.join("");
console.log(b+"quot;);
+ 4
Abdul Lee🎌🇨🇳🇳🇬 That code gave me a lot of confusion too.
Maybe the task wasn't particularly clear.
+ 2
Abdul Lee🎌🇨🇳🇳🇬
Comma (,) should not be replace. In the 3rd case there is comma (,) which should also be included in string.
+ 2
maybe also this thread can help
https://www.sololearn.com/Discuss/2620022/?ref=app
+ 1
Gabriele Gatti Thanks man I've seen my error
+ 1
Gabriele Gatti Precisely. I just followed the example that was given so I could get the same result
+ 1
Abdul Lee, Now it works, check it out.
0
AJ #Learn With Me 👨💻 Still doesn't work
0
Николай Affirmative. Thanks
0
class Add {
constructor(...words) {
this.words = words;
}
//your code goes here
print(){
let st = this.words.map(e =>"quot; + e);
let m = st.join("") + "quot;;
console.log(m);
}
}
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();
Will work 100%