<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 字符串 字符串是一個或多個排在一起的字符,可以用單引號和雙引號包裹。 在單引號包裹的字符串內部可以使用雙引號,同樣的,在雙引號包裹的字符串內部也是可以使用單引號。 ```javascript console.log("hello,'world'!"); console.log('hello,"world"!'); ``` 在源代碼中如果需要使用多行字符串,我們一般使用 + 或者 \ ,但是一般都是使用 + 拼接。 ```javascript console.log('hello,world!' + 'hello,world!' + 'hello,world!hello,world!'); ``` ### 轉換為字符串 > 有兩種方式轉換為字符串 * toString()方法:幾乎每一個值都有toString()方法,除了null和undefined 。 * String()方法:此方法可以將幾乎所有類型的值轉化為字符串。 ~~~javascript //幾乎每個值都有toString方法,除了null和undefined var age = 11; var ageText = age.toString(); console.log(ageText+1); var found = true; var foundText = found.toString(); console.log(foundText); var value1 =10; var value2 = true; var value3 = null; var value4; //String()函數能將任何類型的 console.log(String(value1)); console.log(String(value2)); console.log(String(value3)); console.log(String(value4)); ~~~ ### 3.字符串和數組 字符串可以理解為一個特殊的字符類型的數組,因此可以使用數組的中括號返回某個索引位置的字符。但是不能通過索引位置賦值。 ```javascript var h = "hello"; h[0] = "w"; // 此處不會修改h[0]的值 console.log(h); // hello h.length = 7; console.log(h.length); // 5 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看