Closed imranbarbhuiya closed 2 years ago
Number.isNaN returns true incase the input is NaN.
Number.isNaN returns true incase the input is NaN.
Yeah that's why used !
.
You r saying that if we give a input which isn't a Number then it returns true or you means anything else?
Number.isNaN returns true incase the input is NaN.
Yeah that's why used
!
.You r saying that if we give a input which isn't a Number then it returns true or you means anything else?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#using_isnan You see the problem... It would still not reject everything which is not a number.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite I stumbled across this. I think it would be most suitable, no?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite I stumbled across this. I think it would be most suitable, no?
I was unaware of this xD but I think this is perfect for this purpose. Lmk should I change it to isFinite? As I think using a Number method instead of checking isNan as well as checking number type will be better.
Also I changed code from main branch am I supposed to change do it from dev branch? If so I need to recreate the pr
yeah change it to Number.isFinite for now, unless we find a exeption. and for the branching, it should be fine if you edited the main branch since there are not to many differences. But since you're prettier changed the whole file, it would be nice if you recreate/undo the prettier changes and just commit the real changes again. And then you could also start from the develop branch if you're already at it.
Ok sure I'm closing this for now and will be recreating from dev branch to get rid of the conflict.
Changes
giveaway.endAt
to date!isNaN(input) && typeof input === 'number'
is used to validate the input is a number, but we can check that with!Number.isNan(input)
And sorry, that my prettier changed the code style.
Status