Add simple example of isNaN()
#31
Hello @ManuelOviedo , We need native implementation of isNan function.
There's no prototype of isNaN. That property comes from ECMAScript convention for evaluate if a given value is NaN, if you get to the MDN links there are some links to its own ECMAScript related articles. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN https://tc39.es/ecma262/#sec-value-properties-of-the-global-object-nan
Can you write a program which simple take a string as an input and check if its a number or not. If it's a number return false, else return true. @ManuelOviedo
Can you write a program which simple take a string as an input and check if its a number or not. If it's a number return false, else return true. @ManuelOviedo
I think you missunderstood the purpose of that function. isNaN checks for a value if it's NOT a number and i guess my example is way too clear:
Number.prototype.isNaN = function(testValue){ return isNaN(testValue); }; the above example (same as PR) receives a value and evaluates it with isNaN function and will return true if it's not a number or false if it's a number
Implementation should be done without using in-build functions or specifically don't use isNaN function, or parseInt type of functions