It’s little different in the case of JavaScript substring. substring ( - 4 ) // "Hello this is test" Negative number examples for string methods var string = "Hello this is test" What if you pass a negative number via slice? In this case, it subtracts the number from the length of the string. What if you pass an invalid value or negative numbers as parameters? rules are in place to deal with such scenarios. How to Deal with Negative Numbers using SubString, Substr And Slice Methods in JavaScript?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |