[英]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.
您无法访问它,但您可以假设true
为1
并且false
为0
。
我不知道 javascript 中的任何bit
类型。 如果您担心节省空间并需要存储大量位,则可以结合使用int
和位运算符。 您将操纵每个 int 中的各个位(在大多数系统上为 32)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.