8 lines
259 B
JavaScript
8 lines
259 B
JavaScript
/**
|
|
* Check if the object (string, number, etc.) contains a number.
|
|
* @param {object} n - object to check.
|
|
* @return {Boolean} true, if it is a number, false otherwise.
|
|
*/
|
|
function isNumeric(n) {
|
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
} |