@@DaveGrayTeachesCode Thanks for replying! I went to MDN docs .. came across an example 2.55.toFixed(1) Returns '2.5' -> it rounds down as it can't be represented by a float // closest representable float is lower? What does that mean?
Thank you for another lesson! Honestly I didn't get the concept of Number.isNaN() I went to MDN to get some more information about this method and can't say that it helped. I couldn't think of examples when Number.isNaN() can possibly return "true". But in MDN there are few examples of it - Number.isNaN(NaN); // true Number.isNaN(Number.NaN); // true Number.isNaN(0 / 0); // true
Thanks. The difference between global isNaN() and Number.isNaN is interesting.
3:58
console.log((142.035).toFixed(2));
outputs - 142.03 // Why doesn't it output 142.04??
MDN is the source to help you with these questions: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed
@@DaveGrayTeachesCode Thanks for replying! I went to MDN docs .. came across an example
2.55.toFixed(1)
Returns '2.5' -> it rounds down as it can't be represented by a float // closest representable float is lower?
What does that mean?
Please tell one example of a parameter when
Number.isNaN() will return true?
Looks like you found this in another comment you posted, but Number.isNaN(0/0) returns true.
@@DaveGrayTeachesCode Thankyou!
Number.isNaN(0/0) //returns true?
isNaN() - yes
datatype Number-?
console.log(Number.isInteger(0 / 0)); // returns false?
Thank you for another lesson!
Honestly I didn't get the concept of Number.isNaN()
I went to MDN to get some more information about this method and can't say that it helped. I couldn't think of examples when Number.isNaN() can possibly return "true". But in MDN there are few examples of it -
Number.isNaN(NaN); // true
Number.isNaN(Number.NaN); // true
Number.isNaN(0 / 0); // true
You're welcome! Good follow up on MDN 💯