Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

isfinite javascript

function div(x) {
  if (isFinite(1000 / x)) {
    return 'Number is NOT Infinity.';
  }
  return 'Number is Infinity!';
}

console.log(div(0));
// expected output: "Number is Infinity!""

console.log(div(1));
// expected output: "Number is NOT Infinity."
Comment

PREVIOUS NEXT
Code Example
Javascript :: flatMap() method 
Javascript :: remove object from array javascript 
Javascript :: js filter method in python 
Javascript :: loop react components 
Javascript :: current date jquery and current day 
Javascript :: change image automaticly 
Javascript :: download pdf 
Javascript :: substr javascript 
Javascript :: ember js 
Javascript :: jquery get all data attributes values 
Javascript :: javascript functions 
Javascript :: add class to html tag javascript 
Javascript :: jquery get padding top without px 
Javascript :: jest cannot find module 
Javascript :: js number padding to number of characters 
Javascript :: dynamic forms in react 
Javascript :: module.exports in js 
Javascript :: Destructuring of object in ES6 
Javascript :: Remove duplicates from arrays using reduce 
Javascript :: add object in array state react 
Javascript :: js get last n elements of array 
Javascript :: how to check if string contains substring javascript 
Javascript :: search object array javascript 
Javascript :: multiple class to same click jquery 
Javascript :: promise syntax for javascript 
Javascript :: create a customer in stripe node.js 
Javascript :: .then javascript 
Javascript :: remove object if key is duplicate javascript 
Javascript :: Redirect user when JavaScript is disabled with noscript 
Javascript :: how to calculate time taken for ajax call in javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =