How To Turn A String Into An Int Javascript Snake