Is there a property from an object that I can modify to specify the truth value for the object. For example add a line inside:
var myObj{...}
so that I can determine whether the code block associated with the following if-statement is executed:
if(myObj){
//dosomething
}
Something analogous in Python would be overriding the __bool__
method.