什么是"自动浇注布尔"? [英] What's an "auto-casting bool"?

查看:184
本文介绍了什么是"自动浇注布尔"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下<一个href=\"http://stackoverflow.com/questions/7634343/null-is-type-object-so-its-truthy-whats-going-on-behind-the-scenes/7634374#7634374\">answer到有人提到自动铸造BOOL一previous问题

On the following answer to a previous question someone mentioned an "auto-casting bool"

我猜空具有自动铸造布尔那是假的。这是什么,又是什么在code,使得它看起来像?

I guess null has an auto-casting bool that is false. What is it, and what does the code that makes it look like?

推荐答案

短语自动铸造BOOL是一个贫穷的短语有人用了手。我相信,他们的意思是内部 ToBoolean 操作

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

特别值得注意的是, if语句这就要求 ToBoolean 的前pression。

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

我不知道我周围的V8源$ C ​​$ C的方式,但这里是一个<一个href=\"http://www.google.com/$c$csearch#search&q=toboolean+package%3ahttp://v8%5C.google$c$c%5C.com\"相对=nofollow>搜索 ToBoolean 的V8回购。

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

有关参考V8是用铬和C ++编写的JavaScript执行

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

这篇关于什么是&QUOT;自动浇注布尔&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆