久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      Javascript中的解構(gòu)賦值

      Javascript中的解構(gòu)賦值

      1.變量值進(jìn)行交換

              let a=10,b=20;         console.log(a,b);         [a,b]=[b,a];         console.log(a,b);

      2.數(shù)組解構(gòu)

       // 等號(hào)左邊是右邊的模板,必須一樣         let [a,b,c] =[1,2,3];         console.log(a,b,c);

      可預(yù)設(shè)默認(rèn)值

              [a,b,c='JS'] =[1,2];         console.log(a,b,c);

      可使用歸并參數(shù)

              [a,b,...c] =[1,2,3,5,6,66];         console.log(a,b,...c);

      可省略部分參數(shù)

              [,,c] =[1,2,3,5,6,66];         console.log(c);

      3.對(duì)象解構(gòu)

                ({id,name}={id:10,name:"手機(jī)"});            console.log(id,name);

      推薦:《2021年js面試題及答案(大匯總)》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)