+ 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 RĂ©ponses
+ 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