@cstan/is-digit
v1.0.4
Published
With a one char string as an argument it returns true if it is a digit else false
Downloads
3
Readme
@cstan/is-digit
A commonjs package that returns true if its single character argument is a digit else false.
Installation:
npm install @cstan/is-digit
Use:
const { isDigit } = require("@cstan/is-digit")
let c = "k"; // a one char string
if (isDigit(c)) {
console.log(`'${c}' is a digit.`)
} else {
console.log(`'${c}' is NOT a digit.`)
}
// 'k' is NOT a digit.