Interesting way to inverse number in JavaScript