<address id="xpjh9"><listing id="xpjh9"><meter id="xpjh9"></meter></listing></address>

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
<noframes id="xpjh9">
<noframes id="xpjh9">

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
    <form id="xpjh9"></form><address id="xpjh9"><listing id="xpjh9"><menuitem id="xpjh9"></menuitem></listing></address>

      <noframes id="xpjh9">
      VB.net 2010 視頻教程 VB.net 2010 視頻教程 VB.net 2010 視頻教程
      SQL Server 2008 視頻教程 c#入門經典教程 Visual Basic從門到精通視頻教程
      當前位置:
      首頁 > 網站開發 > JQuery >
      • JavaScript教程之Array,prototype.concat.apply與[].conat.ap

      • 2019-04-27 15:28 來源:未知

       

       一直都知道JS數組Array內置對象有一個concat方法,但是也沒怎么研究過,今天偶然就看了看

        concat是連接一個或多個數組

       返回的是連接后數組的一個副本

      var oldArr=[];

      var arr=[[1,2,3],[4,5,6],[7,8,9],[10,11,12]];

      var newArr=oldArr.conat(arr);

      console.log(newArr);

       

       

       

      console.log(oldArr);//[]  沒有改變

       

      于是乎 我又想到把數組的每一項都當成數組與oldArr連接

      這就需要apply方法了 將數組變成參數列表傳參

      console.log(Array.prototype.concat.apply(Array,arr));

      //結果很奇怪

      沒有得到想到的結果

       

       

       箭頭地方是什么鬼???

       想了想

       Array.prototype.concat.apply(Array,arr);

       不就是Array調用了Array.prototype上的concat然后傳入參數arr

      把Array 換成Number String 等 不就是 借用Array.prototype上的concat方法罷了

      然后把調用者添加到數組的0位置

      我感覺就是 arr.unshift(Array);

      其他情況的話就會 push 了

      看下面的圖就明白了吧

      console.log(Array.prototype.concat.apply(Number,arr));

       

      console.log(Array.prototype.concat.apply(String,arr));

       

      console.log(Array.prototype.concat.apply(RegExp,arr));

       

       好像是這么回事

      所以 把aplly里面的參數改成[]不就好了

      console.log(Array.prototype.concat.apply([],arr));

      可以簡單點寫[].concat.apply([],arr);

       

        數組不僅可以連接數組  數組還可以連接字符串  數字  對象  等

         console.log([].concat({a:2,b:3,c:3}));

       

       他會把對象放在數組里,這里就不能說連接了吧 我中有你嘛

      console.log([].concat("123"}));

       

      根據這些我總結出了  如果 concat傳入的參數不是數組 就不會遍歷 直接暴力添加到數組項

      而參數是數組的話就會遍歷

       

      需要注意的是  千萬不要傻傻的 用String.concat(); Number.concat()等

      上面的是用apply方法改變this指向借用的

      它本身沒有concat

      String.prototype里面有concat但是實現結果不一樣滴!

      只是我個人的理解 希望對大家有幫助

      相關教程
      江苏快3 www.2632s.com | www.973709.com | www.68689k.com | www.50026w.com | www.099816.com | www.313355.com | www.66332b.com | www.526087.com | www.796678.com | www.en06.com | www.c1363.com | www.5666hc.com | www.50052n.com | www.84499w.com | www.303476.com | www.26163w.com | www.26299f.com | www.78700k.com | www.89894z.com | www.60339.cc | www.12455p.com | www.9818g.cc | www.444601.com | www.589196.com | www.501346.com | www.77802e.com | www.36166s.com | www.9356y.com | www.hx6691.com | www.810575.com | www.611026.com | www.506291.com | www.36166d.com | www.tang777.com | www.c3069.com | www.346377.com | www.103658.com | www.3126m.com | www.23040.com | www.35155h.com | www.26878j.com | www.610659.com | www.21202p.com | www.xcw866.com | www.623190.com | www.81678r.com | www.987957.com | www.73736c.com | www.en06.com | www.80065f.com | www.878466.com | www.303482.com | www.919725.com | www.50054u.com | www.898364.com | www.862810.com | www.36788m.com | www.081305.com | www.753956.com | www.911203.com | www.216750.com | www.81520j.com | www.849129.com | www.62118g.com | www.550437.com | www.60007c.com | www.8mcp.com | www.51331c.com | www.808712.com | www.83033z.com | www.77801r.com | www.581166.com | www.3933d.cc | www.176223.com | www.33598g.com | www.196501.com | www.52072r.com | www.225075.com | www.w725.com | www.34788w.com | www.202370.com | www.hx5577.com | www.12455c.com | www.83993n.com | www.589703.com | www.w635.com | www.84141.com | www.106569.com | www.699915.com | www.33598p.com | www.258768.com | www.913812.com | www.39391.cc | www.66653p.com | www.234276.com | www.694880.com | www.5666hc.com | www.309135.com | www.925887.com | www.8499c.com | www.376395.com | www.583792.com | www.az0908.com | www.983jc.com | www.068651.com | www.609535.com | www.mcw7.com | www.022am.cc | www.9478t.com | www.32123t.com | www.99638p.com | www.tcsj.com | www.12455z.com | www.36166r.com | www.39500u.com | www.68689j.com | www.bxcp3.com | www.001059.com | www.239544.com | www.403489.com | www.682542.com | www.8816u.com | www.50074b.com | www.34788y.com | www.50026h.com | www.53900d.com | www.32123j.com | www.9818r.cc | www.hqcp3.com | www.gai00.com | www.47d.cc | www.23hf.com | www.861150.com | www.792587.com | www.550134.com | www.342918.com | www.221095.com | www.177074.com | www.62118e.com | www.00840q.com | www.36788b.com | www.5522t.cc | www.901387.com | www.914903.com | www.50064m.com | www.07163v.com | www.364747.com | www.564696.com | www.310657.com | www.68689x.com | www.29178c.com | www.9478d.com | www.371h.cc | www.cp2838.com | www.544095.com | www.73736e.com | www.66368.com | www.050.la | www.2373m.com | www.hx1162.com | www.558502.com | www.83993a.com | www.41518f.com | www.fh3993.com | www.588703.com | www.87668j.com | www.50074f.com | www.f093.com | www.lcw997.com | www.07163x.com | www.55kcw.com | www.424770.com | www.54968h.com | www.1035s.com | www.684077.com | www.78700k.com | www.0014w.com | www.768399.com | www.90848a.com | www.2632m.com | www.646452.com | www.60108f.com | www.ybao9.com | www.377615.com | www.76520c.com | www.c3714.com | www.177524.com | www.3933s.cc | www.86267b.com | www.1035t.com | www.rcw8811.com | www.50080s.com | www.775706.com | www.39500i.com | www.hcw332.com | www.66332v.com | www.cb3188.com | www.80767g.com | www.cpkk.com | www.77210g.com | www.689631.com | www.96386d.com | www.652392.com | www.60123z.com | www.587344.com | www.8039w.com | www.209881.com | www.gyfc6.com | www.36166n.com | www.726032.com | www.26163m.com | www.214654.com | www.369888a.com | www.60108p.com | www.529411.com | www.781566.com | www.81233m.com | www.901512.com | www.49956s.com | www.499680.com | www.679by.com | www.83033p.com | www.817824.com | www.50024.com | www.81678q.com | www.290282.com | www.979zf.com | www.65707e.com | www.665879.com | www.500cd.com | www.60123z.com | www.053883.com | www.793500.com | www.2373b.com | www.50051n.com | www.444957.com | www.969761.com | www.3890w.com | www.81678s.com | www.152012.com | www.803372.com | www.097wy.com | www.hcjt6.com | www.16878h.com | www.118109.com | www.580896.com | www.946380.com | www.096wy.com | www.61411.cc | www.60108r.com | www.66332n.com | www.186371.com | www.500227.com | www.802533.com | www.c143.vip | www.855271.com | www.gai06.com | www.55czt.com | www.107ak.com | www.35155x.com | www.16878v.com | www.160886.com | www.301871.com | www.464499.com | www.608986.com | www.712012.com | www.809573.com | www.800471.com | www.50064c.com | www.32123s.com | www.33588p.com | www.55885n.com | www.77801j.com | www.018581.com | www.114149.com | www.187397.com | www.381110.com | www.369499.com | www.361770.com | www.178725.com | www.bxcp3.com | www.77803n.com | www.50732i.com | www.80767f.com | www.25688h.com | www.25688f.com | www.750966.com | www.zg80.com | www.663566.com | www.452807.com | www.068617.com | www.36788o.com | www.53539.cc | www.731030.com | www.348499.com | www.73166h.com | www.84499d.com | www.6832t.com | www.hcw332.com | www.756059.com | www.210793.com | www.66332v.com | www.50051b.com | www.66ffi.com | www.565378.com | www.369477.com | www.49956h.com | www.1035d.com | www.725898.com | www.178993.com | www.73166c.com | www.zcwf6.com | www.550347.com | www.78700e.com | www.cll168.com | www.818807.com | www.029509.com | www.23636f.com | www.996745.com | www.128368.com | www.99431.cc | www.603854.com | www.60007e.com | www.910xj.com | www.500907.com | www.50051hh.com | www.hc2388.com | www.178339.com | www.781566.com | www.631259.com | www.12455i.com | www.989778.com | www.78949d.com | www.66qxc.com | www.luck885.com | www.3126u.com | www.506729.com | www.36788d.com | www.810513.com | www.52072r.com | www.hm7388.com | www.81678x.com | www.66qxc.com | www.087079.com | www.77yfa.com | www.97655q.com | www.9889hc.com | www.033916.com | www.hjin2.com | www.80065i.com | www.777768a.com | www.34788a.com | www.808482.com | www.81520s.com | www.tcp969.com | www.35918f.com | www.356686.com | www.7777ae.com | www.021067.com | www.cp701.vip | www.80767t.com | www.536350.com | www.11081.cc | www.78949j.com | www.808731.com | www.6611a.cc | www.52303e.com | www.603694.com | www.9889hc.com | www.36788e.com | www.444019.com | www.ascp4.com | www.60007d.com | www.215463.com | www.809217.com | www.3552e.com | www.50064v.com | www.540877.com | www.cb6588.com | www.66530.cc | www.15355q.com | www.330671.com | www.799845.com | www.083wy.com | www.50022c.com | www.77803i.com | www.500227.com | www.983699.com | www.6832u.com | www.39500c.com | www.175131.com | www.555958.com | www.907118.com | www.tj92.com | www.982pk.com | www.84499c.com | www.53900c.com | www.768299.com | www.504133.com | www.800986.com | www.lcw997.com | www.9fk.com | www.cpw | www.75345.cc | www.8816g.com | www.50732t.com | www.98528h.com | www.68689w.com | www.91233u.com | www.119705.com | www.170882.com | www.202370.com | www.277320.com | www.401345.com | www.397836.com | www.374877.com | www.355243.com | www.348499.com | www.314077.com | www.250209.com | www.160882.com | www.101377.com | www.81520t.com | www.54400r.com | www.26163o.com | www.65707f.com | www.05500w.com | www.3933k.cc | www.ybao1.com | www.535666e.com | www.708286.com | www.530126.com | www.235952.com | www.80065v.com | www.98528c.com | www.07163b.com | www.9889hc.com | www.616777a.com | www.791361.com | www.550174.com | www.177888.com | www.50026u.com | www.50051f.com | www.022h.cc | www.989774.com | www.xinyc8.com | www.135580.com | www.15355w.com | www.3478l.cc | www.737689.com | www.235607.com | www.99788g.com | www.022cq.cc | www.638466.com | www.bxcp3.com | www.33997r.com | www.fcyl6.com | www.541911.com | www.65707f.com | www.cll168.com | www.890702.com | www.109317.com | www.50052w.com | www.ck7786.com | www.233434.com | www.50026n.com | www.976527.com | www.172346.com | www.08588p.com | www.857981.com | www.80767v.com | www.1035e.com | www.572899.com | www.c177.com | www.332069.com | www.81520r.com | www.c2656.com | www.126019.com | www.8667u.com | www.670477.com | www.36788m.com | www.c134.vip | www.52072m.com | www.fh2622.com | www.152918.com | www.3126s.com | www.844141.com | www.88266s.com | www.66ffx.com | www.916720.com | www.196091.com | www.5027.com | www.155301.com | www.88jcw.com | www.178651.com | www.663by.com | www.109076.com | www.00ac.com | www.43818r.com | www.535666e.com | www.41518g.com | www.809215.com | www.35918t.com | www.54968f.com | www.022j.cc | www.75538d.com | www.828701.com | www.55885j.com | www.528335.com | www.2350u.com | www.83993n.com | www.809215.com | www.66026.cc | www.012288.com | www.901013.com | www.zuan222.com | www.038059.com | www.855312.com | www.9478d.com | www.80065q.com | www.658252.com | www.0014h.com | www.43818w.com | www.493600.com | www.hx1165.com | www.33997c.com | www.99638d.com | www.629683.com | www.99fc.cc | www.33598z.com | www.80075d.com | www.516105.com | www.hc5859.com | www.8839r.com | www.35918q.com | www.217380.com | www.689044.com | www.cha64.com | www.22503.cc | www.77114b.com | www.77210l.com | www.307797.com | www.901573.com | www.9cpb.com | www.2109t.com | www.50732b.com | www.50064r.com | www.083019.com | www.595411.com | www.808751.com | www.c300.cc | www.wo41.com | www.9889hc.com | www.5086y.com | www.50732b.com | www.78949p.com | www.50024k.com | www.60123m.com | www.81233g.com | www.99968z.com | www.127179.com | www.178125.com | www.xinyc1.com | www.204500.com | www.225779.com | www.203035.com | www.rcw321.com | www.296979.com | www.292269.com | www.196346.com | www.160881.com | www.96386b.com | www.76520x.com | www.43818t.com | www.99788q.com | www.55885g.com | www.21202s.com | www.5441r.com | www.3126aa.com | www.58fcw.com | www.637012.com | www.832795.com | www.611874.com | www.338063.com | www.99677f.com | www.39500q.com | www.50064x.com | www.1035j.com | www.ascp9.com | www.88djcp.com | www.448910.com | www.029709.com | www.29178g.com | www.27676.cc | www.c137.vip | www.529979.com | www.088185.com | www.08588y.com | www.7782h.com | www.cp8019.cc | www.570981.com | www.153680.com | www.99677l.com | www.656by.com | www.859505.com | www.216750.com | www.97655d.com | www.022ah.cc | www.656270.com | www.97655j.com | www.33997j.com | www.c1391.com | www.401272.com | www.36166w.com | www.686pp.com | www.685044.com | www.99677z.com | www.00665.com | www.866505.com | www.99968z.com | www.cll168.com | www.755907.com | www.71233z.com | www.2109y.com | www.602465.com | www.36787d.com | www.yfa3.com | www.151220.com | www.7782t.com | www.602430.com | www.26163f.com | www.hm3988.com | www.187380.com | www.8039h.com | www.559748.com | www.68689z.com | www.bxcp3.com | www.60123u.com | www.ck09.com | www.78700a.com | www.22fzc.com | www.119705.com | www.555xm.cc | www.163135.com | www.588yc.com | www.244646.com | www.979zf.com | www.xinyc3.com | www.022a.cc | www.54968f.com | www.den60.com | www.73736e.com | www.978351.com | www.50026v.com | www.846631.com | www.60007h.com | www.530891.com | www.0014z.com | www.055969.com | www.c1395.com | www.16878s.com | www.lcw199.com | www.3552u.com | www.022184.com | www.962387.com | www.60123c.com | www.372879.com | www.tang444.com | www.35155s.com | www.558416.com | www.622by.com | www.49956d.com | www.586960.com | www.55kcw.com | www.99638c.com | www.351957.com | www.hx1161.com | www.43818k.com | www.003895.com | www.664043.com | www.88cmc.com | www.68568q.com | www.226705.com | www.lcw199.com | www.107ak.com | www.89894q.com | www.273503.com | www.890517.com | www.0014j.com | www.83993n.com | www.131763.com | www.611036.com | www.ascp1.com | www.9478k.com | www.39500i.com | www.191761.com | www.602470.com | www.966829.com | www.chi32.com | www.81233c.com | www.84499g.com | www.339967.com | www.652561.com | www.am6543.com | www.9889hc.com | www.9205a.com | www.71233w.com | www.61655d.com | www.196079.com | www.529799.com | www.701547.com | www.979631.com | www.66wcw.com | www.2373j.com | www.62355.com | www.83033k.com | www.33588r.com | www.71233d.com | www.81233q.com | www.97655e.com | www.057452.com | www.128083.com | www.190883.com | www.196056.com | www.178259.com | www.165595.com | www.083065.com | www.99968z.com | www.81520l.com | www.76520s.com | www.50054o.com | www.26878w.com | www.78949x.com | www.50064m.com | www.31047.com | www.cll168.com | www.267by.com | www.fcff6.com | www.936570.com | www.781566.com | www.590981.com | www.348918.com | www.055979.com | www.50732n.com | www.68568w.com | www.6832p.com | www.5xct.com | www.855762.com | www.820585.com | www.770001.com | www.536411.com | www.324246.com | www.77803q.com | www.86267t.com | www.1368u.cc | www.933509.com | www.558413.com | www.001832.com | www.79520c.com | www.878zf.com | www.c6093.com | www.564676.com | www.005845.com | www.80767k.com | www.074wy.com | www.955484.com | www.369908.com | www.50732l.com | www.5095h.com | www.910282.com | www.xcw866.com | www.07500w.com | www.588yc.com | www.649677.com | www.99677l.com | www.12455s.com | www.939623.com | www.210793.com | www.50788p.com | www.cb2388.com | www.233896.com | www.50054z.com | www.962095.com | www.155233.com | www.58688.cc | www.737198.com | www.68689x.com | www.544bb.cc | www.404099.com | www.71399n.com | www.935506.com | www.95999w.com | www.102ak.com | www.495568.com | www.65707p.com | www.843933.com | www.50064r.com | www.csgc5.com | www.055976.com | www.1035k.com | www.383571.com | www.33598z.com | www.54968f.com | www.89894z.com | www.799427.com | www.07163r.com | www.815055.com | www.26299m.com | www.572699.com | www.81520t.com | www.709720.com | www.61655r.com | www.596960.com | www.37437.cc | www.303476.com | www.022x.cc | www.106569.com | www.fh1188.com | www.60007p.com | www.899495.com | www.12455v.com | www.664043.com | www.32123p.com | www.379802.com | www.3005.am | www.96386o.com | www.777768a.com | www.99788s.com | www.579699.com | www.2109p.com | www.77803m.com | www.809699.com | www.10113.com | www.108382.com | www.768299.com | www.36787h.com | www.xinyc2.com | www.ch8944.com | www.50064l.com | www.180209.com | www.912451.com | www.36829.com | www.001059.com | www.763117.com | www.3668r.com | www.60108i.com | www.582909.com | www.kc67.com | www.50052j.com | www.96386r.com | www.607325.com | www.hu508.com | www.36788w.com | www.81233i.com | www.567106.com | www.hm5577.com | www.9478t.com | www.50732h.com | www.305388.com | www.766898.com | www.tj92.com | www.7782s.com | www.97655y.com | www.049988.com | www.505433.com | www.01hfcp.com | www.gyfc4.com | www.3478g.cc | www.50989f.com | www.52072p.com | www.177564.com | www.526820.com | www.820687.com | www.hc2988.com | www.917gc.com | www.9205c.com | www.66376m.com | www.36166j.com | www.77114t.com | www.219077.com | www.401272.com | www.636121.com | www.866269.com | www.c9221.com | www.fo64.com | www.bxcp3.com | www.1035f.com | www.6661e.cc | www.7782m.com | www.39058.cc | www.9356p.com | www.26299y.com | www.50732k.com | www.66376m.com | www.66332g.com | www.60123k.com | www.50026x.com | www.32123r.com | www.94580.cc | www.7782a.com | www.2350g.com | www.022n.cc | www.8mcp.com | www.c5127.com | www.949410.com | www.837772.com | www.641638.com | www.503662.com | www.223559.com | www.86267l.com | www.39957c.com | www.67258b.com | www.7793p.com | www.699by.com | www.179012.com | www.809216.com | www.508477.com | www.43818x.com | www.588yc.com | www.cf9906.com | www.701489.com | www.338031.com | www.76520c.com | www.71399y.com | www.2109c.com | www.c1393.com | www.627792.com | www.235944.com | www.50054u.com | www.26299j.com | www.ywzuqiu.com | www.732400.com | www.236002.com | www.32123u.com | www.6364v.com | www.c9218.com | www.581477.com | www.bxcp3.com | www.36788l.com | www.sygj1.com | www.567231.com | www.73166j.com | www.9205g.com | www.939884.com | www.313055.com | www.99788l.com | www.033.la | www.566011.com | www.50054o.com | www.930xj.com | www.652982.com | www.77801a.com | www.3478x.cc | www.684244.com | www.68568o.com | www.888hy.cc | www.hcw266.com | www.33588w.com | www.zc35.com | www.308388.com | www.49956h.com | www.864355.com | www.77801m.com | www.986jc.com | www.383566.com | www.52072p.com | www.866546.com | www.68689g.com | www.88kcw.com | www.309939.com | www.11774.cc | www.590833.com | www.68682h.com | www.794918.com | www.26299c.com | www.809215.com | www.53900l.com | www.c7238.com | www.73166h.com | www.flff0.com | www.81233m.com | www.9jjc.com | www.88065e.com | www.9889hc.com | www.77803i.com | www.c1968.com | www.50054a.com | www.912481.com | www.36788y.com | www.848166.com | www.66653y.com | www.581905.com | www.50069.com | www.354211.com | www.055x.cc | www.bxcp3.com | www.978137.com | www.99099hh.com | www.662358.com | www.11044.cc | www.133902.com | www.gyfc0.com | www.26163j.com | www.599399.com | www.3136aa.com | www.77802i.com | www.755908.com | www.cll168.com | www.99677x.com | www.849077.com | www.9356c.com | www.96386a.com | www.810625.com | www.9356c.com | www.81520e.com | www.631799.com | www.2109aa.com | www.49956w.com | www.510477.com | www.qucp7.com | www.71233x.com | www.220892.com | www.897060.com | www.5484b.com | www.60123z.com | www.535059.com | www.c3714.com | www.15355c.com | www.77114i.com | www.550347.com | www.c805.cc | www.8667y.com | www.33997d.com | www.237988.com | www.698771.com | www.w095.com | www.9155g.cc | www.36788f.com | www.168212.com | www.615121.com | www.6769a1.com | www.3478n.cc | www.80075g.com | www.68682n.com | www.306503.com | www.658997.com | www.959591.com | www.99jti.com | www.5555y.cc | www.65707r.com | www.39500k.com | www.89894j.com | www.254499.com | www.549577.com | www.666937.com | www.910355.com | www.c6002.com | www.3qxc.com | www.0014e.com | www.8839d.com | www.33588j.com | www.81520j.com | www.32123l.com | www.50080e.com | www.61233b.com | www.77801b.com | www.81520o.com | www.96386d.com | www.96386l.com | www.99638n.com | www.96386z.com | www.97655e.com | www.081503.com | www.150957.com | www.117035.com | www.178215.com | www.111505.com | www.86267d.com | www.50074g.com | www.97655r.com |