繁体   English   中英

JavaScript 中是否有适当的“位”之类的东西?

[英]Is there such a thing as a proper `bit` in JavaScript?

I know that there is a Boolean object in JavaScript, but I'm wondering if there is a way to access the metal, the raw single bit that lives at the heart of this Boolean object.

您无法访问它,但您可以假设true1并且false0

我不知道 javascript 中的任何bit类型。 如果您担心节省空间并需要存储大量位,则可以结合使用int位运算符 您将操纵每个 int 中的各个位(在大多数系统上为 32)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM