Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
ŠŠ¾ŃŠæŠ¾Š“Š°, Š²Š¾ŠæŃŠ¾Ń ŠæŠ¾ Š·Š°Š“Š°Š½ŠøŃ Ā«ŃŠ»Š¾Š²Š°Ā» Š² JS
Š”Š¾Š±ŃŃŠ²ŠµŠ½Š½Š¾, ŠŗŠ¾Š“ 100% ŃŠ°Š±Š¾ŃŠøŠ¹, Š²ŃŠ²Š¾Š“ Š²ŠµŃŠ½ŃŠ¹, Š½Š¾ ŠæŠ¾ŃŠµŠ¼Ń-ŃŠ¾ Š½Šµ ŠæŃŠ¾Ń Š¾Š“ŠøŃ ŠæŃŠ¾Š²ŠµŃŠŗŃ ŠæŃŠøŠ»Š¾Š¶ŠµŠ½ŠøŠµŠ¼. ŠŠ¾ŠæŃŠ¾Š±Š¾Š²Š°Š» ŃŠ¶Šµ Ń 10Š¾Šŗ ŃŃŠ¶ŠøŃ ŠŗŠ¾Š“Š¾Š², ŠŗŠ¾ŃŠ¾ŃŃŠµ, ŠæŠ¾ Š·Š°Š²ŠµŃŠµŠ½ŠøŃŠ¼ Š“ŃŃŠ³ŠøŃ Š»ŃŠ“ŠµŠ¹, ŠæŃŠµŠŗŃŠ°ŃŠ½Š¾ ŠæŃŠ¾Ń Š¾Š“ŠøŠ»Šø ŠæŃŠ¾Š²ŠµŃŠŗŃ, Š½Š¾ Ń Š¼ŠµŠ½Ń Š½Šø Š¾Š“ŠøŠ½ Š½Šµ ŠæŃŠ¾ŃŃŠ». ŠŃŃŃ Š²Š¾Š·Š¼Š¾Š¶Š½Š¾ŃŃŃ Š½Š°ŠæŠøŃŠ°ŃŃ Š² ŃŠ°ŠæŠæŠ¾ŃŃ?
15 Respostas
+ 4
Kirill Kapytov , I found something - there is a change in the words. Now the comma ", " is missing from the arguments. It is mentioned in this discussion https://www.sololearn.com/Discuss/2630096/?ref=app
+ 3
class Add {
constructor(...words) {
this.words = words;
this.print = function(){
var str = this.words.join("quot;);
var b = "quot;+str+"quot;;
console.log(b);
};
};
};
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();
+ 2
Kirill Kapytov , your code gives the expected output, although there are some unnecessary lines and it could be shortened. Maybe there is an error in the test - it's locked and it's hard to guess. I tried again my solution which passed the test last week, now it shows wrong. That's why I think something is wrong with the task or the test or both.
+ 2
Kirill Kapytov, you are welcome. Maybe it's a good idea to report it to SoloLearn.
+ 2
Kirill Kapytov , you are welcome š±
+ 1
ŠÆ Š²Š¾Ń ŃŠ°Šŗ ŃŠ“ŠµŠ»Š°Š»
class Add {
constructor(...words) {
this.words = words;
for(var i=0;i<=words.length;i=i+2){
words.splice(i, 0, '#x27;);
}
console.log(words.join(""));
}
//Š²Š°Ń ŠŗŠ¾Š“
}
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();*/
+ 1
There was a "," symbol in the word list, but it wasn't in the answer, so my answer didn't pass
0
Kirill Kapytov , show your code linked to the Playground. That's the only way to get help.
0
Kirill Kapytov , link it to the Playground, then it's easier to check.
0
TheWhĀ”teCat š§š¬ what you think abt this?
0
TheWhĀ”teCat š§š¬ you confirmed my thoughts, thanks.
0
TheWhĀ”teCat š§š¬ yea. I think so too.
0
TheWhĀ”teCat š§š¬ you are the God! It works! I delete ā,ā and it was verified!
0
class Add {
constructor(...words) {
this.words = words;
}
print() {
var result;
result = this.words.join("quot;);
result = "quot;+result+"quot;;
console.log(result);
}
}
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();