Application on node.js There is main.js, in it:
require('./tools.js'); console.log(Number.isNumeric(111)); Next, there are tools.js, in it:
Number.prototype.isNumeric = function (n) { return !isNaN(parseFloat(n)) && isFinite(n); }; Result:
console.log(Number.isNumeric(111)); ^ TypeError: Number.isNumeric is not a function at Object.<anonymous> (/home/eman/bestapp_backend/lib/main.js:21:20) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Function.Module.runMain (module.js:575:10) at startup (node.js:160:18) at node.js:456:3 Actually the question, what to do and how?