+ 2
[Solved]Why str.charAt(-1) doesn't work?
It's a challenge code Named "Gapful Numbers". My code only works for 3 numbers. Why the negative index doesn't work? https://code.sololearn.com/W91RQKB05NE3/?ref=app
3 Answers
+ 3
You are trying to access the character at index -1, and that doesn't really exist. You can either use numStr.slice(-1), or numStr.charAt(numStr.length - 1)
+ 2
Ok, Ok Thank u so muchâ€
+ 1
no
![Raihan Arefinđ§đ©  [Thunder_RabbitâĄâĄ] - avatar](https://blob.sololearn.com/avatars/b5996aaf-cc32-4705-97ec-e3f833277938.jpg)




