Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js is numeric

function isNumeric(num) {
    if (num === '' || num === null) {
        return false
    }
    return !isNaN(num)
}

isNumeric('') //false
isNumeric('7') //true
isNumeric(7) //true
isNumeric('7a') //false
isNumeric('a') //false
isNumeric(null) //false
isNumeric(0) //true
isNumeric('0') //true
isNumeric(true) //true
isNumeric(false) //true
Comment

PREVIOUS NEXT
Code Example
Javascript :: replace url without reload js 
Javascript :: allow cors express 
Javascript :: js get day month year 
Javascript :: javascript window.history.pushstate 
Javascript :: string replace in javascript 
Javascript :: javascript random int in range 
Javascript :: sort from the key value js 
Javascript :: roblox headshot image js 
Javascript :: js api call 
Javascript :: lottie react 
Javascript :: js check window active 
Javascript :: js send get method 
Javascript :: transitionduration 
Javascript :: swapping elements in an array 
Javascript :: jquery get all checkbox checked 
Javascript :: google script wait 
Javascript :: how to fetch api in reactjs using axios 
Javascript :: Finding HTML Element by Id 
Javascript :: vue js cdn link 
Javascript :: react router multiple path 
Javascript :: convert hex code to rgb javascript 
Javascript :: remove specific property from json object javascript 
Javascript :: merge two objects javascript 
Javascript :: flutter access json object inside object 
Javascript :: js append en tête 
Javascript :: get url params with js 
Javascript :: if array has multiple duplicate value number them accordingly 
Javascript :: jquery value of input 
Javascript :: check undefined in javascript 
Javascript :: check palindrome javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =