I am a Developer, Blogger and Coffee addict. Java developer by profession, Q2A developer by addiction. This is my personal website where I write few stuff which could be useful for other developers.
© 2020. All rights reserved.
var a = 10 , b = 20 ; console.log("a = " + a + " , b = " + b); // a = 10 , b = 20 b = [a, a = b][0]; // swap the variables console.log("a = " + a + " , b = " + b); // a = 20 , b = 10
~~0.125
~~1
~~1.6
~~"2.59"
~~-2.8
~~"Apple"
~~[]
~~null
Note -: It never returns NaN. If it fails, it just returns 0
function isNumeric (arg) { return !isNaN(parseFloat(arg)) && isFinite(arg); }
isNumeric(10)
isNumeric(10.234)
isNumeric(0.215)
isNumeric('10')
isNumeric('10.234')
isNumeric('0.215')
isNumeric('')
isNumeric('Qwerty')
isNumeric('43Agd')