javascript - Check if a field of type string/number is empty -


I am working with my application. I have columns that differ on numbers from string datatype, I am facing some problem while one grid is valid for the vacuum of cells. It seems confusing and frustrating as easy as

It is that I'm using to check if the field is empty:

  If (value == "") {// work here}   

This works fine for columns with the string datatype, but when the datatype If the number is the value of , then it fails to check the value as at that time nan I have mentioned several methods, lake Neither in vain, I also want to avoid nested or unnecessary IFS in this case ..

As a check can be done to check

  as if (! Value) {// work here}   

Which is true 0 , "" , zero , undefined , false and > nan

or if you want to test, the field is empty not you only have one authenticity Values ​​

  If (value) {// works here}   

Which evaluates true If the value is not not false (none above)

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -