Files
d3-spring-model/examples/js/distances/numeric.js
2018-03-22 16:40:27 +00:00

9 lines
261 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);
}