<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之旅 廣告
                ## 問題 Problem 你想使用數組來做值交換。 You want to use an array to swap variables. ## 方法 Solution 使用CoffeeScript的[解構賦值](http://jashkenas.github.com/coffee-script/#destructuring)語法: Use CoffeeScript’s?[destructuring assignment](http://jashkenas.github.com/coffee-script/#destructuring)?syntax: ~~~ a = 1 b = 3 [a, b] = [b, a] a # => 3 b # => 1 ~~~ ## 討論 Discussion 解構賦值允許交換兩個值,而無需使用中間變量。 Destructuring assignment allows swapping two values without the use of a temporary variable. 當迭代數組需要保證迭代最短的數組時,這個特性相當有用: This can be useful when traversing arrays and ensuring iteration only happens over the shortest one: ~~~ ray1 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ray2 = [ 5, 9, 14, 20 ] intersection = (a, b) -> [a, b] = [b, a] if a.length > b.length value for value in a when value in b intersection ray1, ray2 # => [ 5, 9 ] intersection ray2, ray1 # => [ 5, 9 ] ~~~
                  <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>

                              哎呀哎呀视频在线观看