0
avstuff
9y

Why JS is terrible at string manipulation.

how they implemented it
str.substring(start,end)

how it should be
str.substring(start,length)

Comments
  • 0
    substr?
  • 0
    I meant to specify "it" as the substring String method.

    It seems far more intuitive to designate starting index and length vs. starting index and ending index.
  • 3
    That's exactly what str.substr() does. There are two separate methods for a reason
  • 0
    @Kolyness I have to admit, I feel a bit silly now.
Add Comment