Sunday, 17 July 2016

Javascript - Alternative to Slice

I want to shift the first letter of a word off and store it in a variable. Is there a way to do this in one statement?

Obviously this works, but it's longer than I'd like

new var = str.slice(0,1)
str = str.substr(1)



from Recent Questions - Stack Overflow http://ift.tt/29MNdfk
via https://ifttt.com/ IFTTT

No comments:

Post a Comment