+1

quiz

Why are there such tasks? Which do not reflect the specifics of the language, and forced to perform arithmetics operation? They have no sense. What is the output of this code? var a = "I love coding"; a = a[7]+a[3]+a[a.length-5]+a[2]; alert(a);

4/12/2019 8:52:26 PM

Vladimir (Tomsk)

7 Answers

New Answer

+6

This specific one is simple and made for beginners to test their knowing that counting starts from 0 and that the last character is length-1 not length. It seams simple, but for people just starting it's hard enough to used to it. Anyway challenges are created mostly by users and get approved by users too. So SoloLearn doesn't take a big part in it.

+4

They are meant to improve your logic, help you understand code better and faster.

+2

Nazar Shved often - yes. But not in this example. Never count length of string or do similar routine operations.

+1

Vladimir Maznev (Tomsk) is correct, challenges should be made to reflect concepts, not put users under crazy math calculations

+1

I _ l o v e _ c o d i n g 0,1,2,3,4,5,6,7,8,9,10,11,12 a length: 1 (I) + 1(space) + 4 (love) + 1 (space) + 6 (coding) = 13 a[7]> c a[3]> o a[8]> o (a.length - 5) a[2]> l 😎🙋‍♂️🕊️ Keep cool 😉

0

This is not arithmetic operation Plus operator is overloaded by String.prototype.concantenation https://code.sololearn.com/WYK8Yun7Y5nI/?ref=app

0

so why creators of this app cannot make the “divisions” or ranks in each language. i am bored of answering “begginer” tasks 50% of time