- 1

My solution to words problem is not getting accepted by sololearn test case. What's wrong with what I wrote?

https://code.sololearn.com/cOHzvJeWQ8EY/?ref=app

2nd Dec 2020, 6:43 PM
Abdul Lee🎌🇳🇬
Abdul Lee🎌🇳🇬 - avatar
10 odpowiedzi
+ 3
var a = this.words.map((word) => "
quot;+word); var b = a.join(""); console.log(b+"
quot;);
2nd Dec 2020, 9:40 PM
Gabriele Gatti
Gabriele Gatti - avatar
+ 4
Abdul Lee🎌🇨🇳🇳🇬 That code gave me a lot of confusion too. Maybe the task wasn't particularly clear.
2nd Dec 2020, 9:54 PM
Gabriele Gatti
Gabriele Gatti - avatar
+ 2
Abdul Lee🎌🇨🇳🇳🇬 Comma (,) should not be replace. In the 3rd case there is comma (,) which should also be included in string.
2nd Dec 2020, 6:46 PM
A͢J
A͢J - avatar
+ 2
10th Dec 2020, 9:18 PM
Alessandro Dari
Alessandro Dari - avatar
+ 1
Gabriele Gatti Thanks man I've seen my error
2nd Dec 2020, 9:50 PM
Abdul Lee🎌🇳🇬
Abdul Lee🎌🇳🇬 - avatar
+ 1
Gabriele Gatti Precisely. I just followed the example that was given so I could get the same result
2nd Dec 2020, 10:02 PM
Abdul Lee🎌🇳🇬
Abdul Lee🎌🇳🇬 - avatar
+ 1
Abdul Lee, Now it works, check it out.
7th Dec 2020, 8:42 PM
Николай
Николай - avatar
0
2nd Dec 2020, 6:56 PM
Abdul Lee🎌🇳🇬
Abdul Lee🎌🇳🇬 - avatar
0
Николай Affirmative. Thanks
7th Dec 2020, 8:43 PM
Abdul Lee🎌🇳🇬
Abdul Lee🎌🇳🇬 - avatar
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%
14th Dec 2021, 2:28 PM
Aasif Zakir