Skip to content Skip to sidebar Skip to footer

What's An "auto-casting Bool"?

On the following answer to a previous question someone mentioned an 'auto-casting bool' I guess null has an auto-casting bool that is false. What is it, and what does the code tha

Solution 1:

The phrase "auto-casting bool" is a poor phrase someone used off hand. I believe what they mean is the internal ToBoolean operation

Of special note is the if statement which calls ToBoolean on the expression.

I don't know my way around the v8 source code but here is a search for ToBoolean on the v8 repo.

For reference v8 is the javascript implementation used by chrome and written in C++

Post a Comment for "What's An "auto-casting Bool"?"