<legend id='zc9Ji'><style id='zc9Ji'><dir id='zc9Ji'><q id='zc9Ji'></q></dir></style></legend>

  1. <small id='zc9Ji'></small><noframes id='zc9Ji'>

    <tfoot id='zc9Ji'></tfoot>
        <bdo id='zc9Ji'></bdo><ul id='zc9Ji'></ul>
      <i id='zc9Ji'><tr id='zc9Ji'><dt id='zc9Ji'><q id='zc9Ji'><span id='zc9Ji'><b id='zc9Ji'><form id='zc9Ji'><ins id='zc9Ji'></ins><ul id='zc9Ji'></ul><sub id='zc9Ji'></sub></form><legend id='zc9Ji'></legend><bdo id='zc9Ji'><pre id='zc9Ji'><center id='zc9Ji'></center></pre></bdo></b><th id='zc9Ji'></th></span></q></dt></tr></i><div id='zc9Ji'><tfoot id='zc9Ji'></tfoot><dl id='zc9Ji'><fieldset id='zc9Ji'></fieldset></dl></div>

      转换字符串“true"/“假"为布尔值

      时间:2023-09-04

      • <tfoot id='AKiCH'></tfoot>

        1. <i id='AKiCH'><tr id='AKiCH'><dt id='AKiCH'><q id='AKiCH'><span id='AKiCH'><b id='AKiCH'><form id='AKiCH'><ins id='AKiCH'></ins><ul id='AKiCH'></ul><sub id='AKiCH'></sub></form><legend id='AKiCH'></legend><bdo id='AKiCH'><pre id='AKiCH'><center id='AKiCH'></center></pre></bdo></b><th id='AKiCH'></th></span></q></dt></tr></i><div id='AKiCH'><tfoot id='AKiCH'></tfoot><dl id='AKiCH'><fieldset id='AKiCH'></fieldset></dl></div>

              <tbody id='AKiCH'></tbody>

            <small id='AKiCH'></small><noframes id='AKiCH'>

                <bdo id='AKiCH'></bdo><ul id='AKiCH'></ul>
                <legend id='AKiCH'><style id='AKiCH'><dir id='AKiCH'><q id='AKiCH'></q></dir></style></legend>

              • 本文介绍了转换字符串“true"/“假"为布尔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个包含 "true""false" 的 JavaScript 字符串.

                I have a JavaScript string containing "true" or "false".

                如何在不使用 eval 函数的情况下将其转换为布尔值?

                How may I convert it to boolean without using the eval function?

                推荐答案

                var val = (string === "true");
                

                这篇关于转换字符串“true"/“假"为布尔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:真值和假值的相等性 (JavaScript) 下一篇:为什么 {} == false 评估为 false 而 [] == false 评估为 true?

                相关文章

                  <bdo id='XmNj7'></bdo><ul id='XmNj7'></ul>
                <i id='XmNj7'><tr id='XmNj7'><dt id='XmNj7'><q id='XmNj7'><span id='XmNj7'><b id='XmNj7'><form id='XmNj7'><ins id='XmNj7'></ins><ul id='XmNj7'></ul><sub id='XmNj7'></sub></form><legend id='XmNj7'></legend><bdo id='XmNj7'><pre id='XmNj7'><center id='XmNj7'></center></pre></bdo></b><th id='XmNj7'></th></span></q></dt></tr></i><div id='XmNj7'><tfoot id='XmNj7'></tfoot><dl id='XmNj7'><fieldset id='XmNj7'></fieldset></dl></div>
                <legend id='XmNj7'><style id='XmNj7'><dir id='XmNj7'><q id='XmNj7'></q></dir></style></legend>

                1. <tfoot id='XmNj7'></tfoot>
                2. <small id='XmNj7'></small><noframes id='XmNj7'>