Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • What is the real length? And the type of it? Commented Jul 20, 2017 at 20:57
  • You need to add second parameter as 1 Commented Jul 20, 2017 at 20:58
  • You can use negative index to indicate count from last like lettersA.splice(-1,1); or if its just a single element lettersA.pop(); lettersA.splice(lettersA.length-1); should also work though. Commented Jul 20, 2017 at 21:03
  • And what exactly returns NaN, your debugging, which we can't see? Please elaborate your question. Commented Jul 20, 2017 at 21:06
  • The NaN implies Not a Number - is lettersA definitely an array and not an object? Commented Jul 20, 2017 at 21:19