I have found out that in JavaScript it is possible to use bare string in if condition. I mean something like this:
var condition = "";
if (condition) {
//we will never come here
}
However, it feels very weird for me because, for example, in Java this code would not compile. I try to understand what is happening with this string behind the scene, but fail for now.
Could you explain to me what happens in this case?
P.s. Moreover, if the variable condition is not initialized at all then it is still fine and the result will be the same. Feels that JavaScript allows quite a lot of these things.