j-delaney / back-to-backspace

https://chrome.google.com/webstore/detail/back-to-backspace/cldokedgmomhbifmiiogjjkgffhcbaec
MIT License
45 stars 14 forks source link

Thanks for the extension, felt like contributing. #8

Closed izy521 closed 8 years ago

izy521 commented 8 years ago

I too was salty about the update, but found this :D!

Not sure if speed is key in such a situation, but using an .indexOf() (or .includes() if you want to be all ES6) is faster than setting variables and using a .forEach(). Also, instead of using an if else, we can just use a ternary operator!

j-delaney commented 8 years ago

Thanks! I'm glad you like the extension. I appreciate your contribution :) It makes the code a lot more concise!