gpt4 book ai didi

google-closure - 谷歌闭包库 : What's the "correct" way to parse a boolean?

转载 作者:行者123 更新时间:2023-12-02 00:13:09 25 4
gpt4 key购买 nike

我在处理 Google Closure 时学到的一件事是,该库几乎拥有我在原始数据操作和管理方面可能想要的一切。我要做的是在它之上构建组件。

今天我试图从一个字符串中解析一个 bool 值。我很惊讶没有在 Google Closure Library 中找到任何东西来做这件事。

我是否应该通过问题中引用的技术自己构建它“How can I convert a string to boolean in JavaScript? ”,或者是否有另一种“Google Closure way”™ 来解析我未能找到的 bool 值?

最佳答案

不,没有关闭方法可以做到这一点。

您要么遵循您链接到的问题中提到的建议,要么创建您自己的方法,其中包含您认为正确的字符串和错误的字符串。

关于google-closure - 谷歌闭包库 : What's the "correct" way to parse a boolean?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14492165/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com