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?

Closed due to the fact that it was off topic by aleksandr barakin , Streletz , user194374, Suvitruf , Grundy Jul 3 '16 at 6:52 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reasons:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - aleksandr barakin, Suvitruf, Grundy
  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Streletz, Community Spirit
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    fix:

     Number.isNumeric = function (n) { return !isNaN(parseFloat(n)) && isFinite(n); };