Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to check if a number is float javascript

function isInt(n){
    return Number(n) === n && n % 1 === 0;
}

function isFloat(n){
    return Number(n) === n && n % 1 !== 0;
}
Comment

how to cheack if a number is an integer or float in javascript

console.log(Number.isInteger(123)); // returns true
console.log(Number.isInteger(123.44)); // returns false
Comment

PREVIOUS NEXT
Code Example
Javascript :: hide html element with javascript 
Javascript :: scrollto jquery 
Javascript :: js string startswith ignore case 
Javascript :: retour à la ligne react native 
Javascript :: useHistory react testing 
Javascript :: how to set state when change viewport react 
Javascript :: get current date 
Javascript :: js json groupby prop 
Javascript :: how to reverse an array in javascript 
Javascript :: how to use sweet alert in vue js 
Javascript :: lazy loading pagination react npm 
Javascript :: javascript string pop 
Javascript :: Get day first 3 letters name js 
Javascript :: jquery change text color 
Javascript :: open new tab with angular router 
Javascript :: console.log javascript 
Javascript :: how do i remove all vowels from a string in javascript and return the result 
Javascript :: character limit regex 
Javascript :: get first word of string js 
Javascript :: React Unmounting Lifecycle Method 
Javascript :: how create a delay for html js 
Javascript :: javascript delete first character from string 
Javascript :: jquery disable option by value 
Javascript :: javascript send post 
Javascript :: How to insert divider in react native 
Javascript :: how to cut a string uptil specific character javascript 
Javascript :: js get data from form 
Javascript :: js fizzbuzz 
Javascript :: how to run different node app on server different domains 
Javascript :: try catch in node js 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =