+ 1

Please I need help on why the alert gives a value of 1

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

19th Jan 2020, 9:38 AM
Shazzar
Shazzar - avatar
3 odpowiedzi
+ 2
because you got the length of a single char: str = "Hello" str[str.length-1] = str[3] = "o" so, str[str.length-1].length = 1
19th Jan 2020, 9:49 AM
visph
visph - avatar
+ 1
Shazzar Not exactly sure. What r u wanting it to say?
19th Jan 2020, 9:45 AM
Ginfio
Ginfio - avatar
0
Thanks visph it is now clear
19th Jan 2020, 10:36 PM
Shazzar
Shazzar - avatar