quiz | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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);

12th Apr 2019, 8:52 PM
Vladimir {Tomsk}
Vladimir  {Tomsk} - avatar
7 Answers
+ 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.
12th Apr 2019, 9:37 PM
Nazar Shved
Nazar Shved - avatar
+ 4
They are meant to improve your logic, help you understand code better and faster.
12th Apr 2019, 9:06 PM
Nazar Shved
Nazar Shved - avatar
+ 2
Nazar Shved often - yes. But not in this example. Never count length of string or do similar routine operations.
12th Apr 2019, 9:12 PM
Vladimir {Tomsk}
Vladimir  {Tomsk} - avatar
+ 1
Vladimir Maznev (Tomsk) is correct, challenges should be made to reflect concepts, not put users under crazy math calculations
12th Apr 2019, 9:43 PM
Dlite
Dlite - avatar
+ 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 😉
13th Apr 2019, 2:17 AM
Nic!
Nic! - avatar
0
This is not arithmetic operation Plus operator is overloaded by String.prototype.concantenation https://code.sololearn.com/WYK8Yun7Y5nI/?ref=app
13th Apr 2019, 3:03 AM
Gordon
Gordon - avatar
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
18th Apr 2019, 1:33 PM
Sadyk
Sadyk - avatar