- I am trying to understand a small piece of code
I thought
!!in javascript does the not operator two timesvar result = !!String("false");so I thought for the above code it will return as
false- but it returns
true..and can you tell me why the type isboolean?
!!does, but why it returns a different result than he expected with this particular argument."false"is in fact true!always converts its argument to a boolean, so!!<anything>is not the same as<anything>unless<anything>is already a boolean.