isOn2
isOn2 is a JavaScript function designed to determine if a given number is an "on-two" number. An on-two number is defined as a positive integer where the number of set bits (bits with a value of 1) in its binary representation is equal to two.
The function checks for two conditions. First, it verifies that the input `n` is indeed a number
If the input passes these initial checks, the function proceeds to count the set bits in the
Once the count of set bits is obtained, the function compares this count to the value 2.