1

Im using a condition in angular js as follows:

if( selectedVal == '' && selectedVal === null)
{
  /*some function()*/
}

When the selectedVal is 0(zero), the condition is getting true. Please some one help me to resolve..

Indhu
  • 371
  • 1
  • 5
  • 18
  • 1
    Can you provide a plunker, or the full code? Are you sure you are using === instead of == ? – illeb Sep 28 '16 at 07:00
  • give us fiddle or running example? – Pandiyan Cool Sep 28 '16 at 07:04
  • ya its my mistake. Once i include === for ' ' check its working... – Indhu Oct 05 '16 at 12:38
  • Possible duplicate of [Which equals operator (== vs ===) should be used in JavaScript comparisons?](http://stackoverflow.com/questions/359494/which-equals-operator-vs-should-be-used-in-javascript-comparisons) – Gonzalo.- Mar 17 '17 at 20:52
  • 1
    == equal value whatever the type of variable may be, but === equals also checka for the type of variables are equal or not. – Indhu Mar 21 '17 at 11:59

0 Answers0