Using Javascript idiom for identifying number as integer