0
Господа, вопрос по заданию «слова» в JS
Собственно, код 100% рабочий, вывод верный, но почему-то не проходит проверку приложением. Попробовал уже с 10ок чужих кодов, которые, по заверениям других людей, прекрасно проходили проверку, но у меня ни один не прошёл. Есть возможность написать в саппорт?
15 Réponses
+ 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();