I have an object that returns a value if successful and false (or nil) if it failed.
i want to assign that value to a variable
if(var1 = [object foo])
{
//if the [object foo] returned a variable, goes here
}
else
{
//[object foo] returned FALSE (or nil), go here
}
can an If statement detected if an assignment was valid?
Not sure I understand your question, but let me try and explain a few situations you can check
1) Property contains value
2) Assignment to a variable was successful
3) Previous assignment of a variable was successful