Skip to content
7aimezPublic

About

A simple funtion to decide if the argument is a number.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

isNum() function

A simple funtion to decide if the argument is a number.

How does it work?

The function uses a simple if function to check if it is a numerical value. It uses the variable boolean, (value - value == 0) which will return true if value is numerical but false if not. The whole function is:

function isNum(value) {
  if (value - value == 0) {
    return true;
  } else {
    return false;
  };
};

Output

The function is used to output a boolean based upon if value is numerical. If you write the script,

boolean = isNum(25);

boolean will equal true. But if you write the script,

boolean = isNum("25");

boolean will equal false.

About

A simple funtion to decide if the argument is a number.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages