比较版本

Array

修订版 78264:

由 Oatn 在 进行的修订 78264

修订版 78265:

由 Mickeyboy 在 进行的修订 78265

标题:
Array
Array
网址缩略名:
Core_JavaScript_1.5_Reference/Global_Objects/Array
Core_JavaScript_1.5_Reference/Global_Objects/Array
内容:

修订版 78264
修订版 78265
n299            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen299            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/pop">pop</a>>ects/Array/pop" title="cn/Core_JavaScript_1.5_Reference/Global_Ob
 >jects/Array/pop">pop</a>
n311            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen311            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/push">push</a>>ects/Array/push" title="cn/Core_JavaScript_1.5_Reference/Global_O
 >bjects/Array/push">push</a>
n323            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen323            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/reverse">reverse</a>>ects/Array/reverse" title="cn/Core_JavaScript_1.5_Reference/Globa
 >l_Objects/Array/reverse">reverse</a>
n335            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen335            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/shift">shift</a>>ects/Array/shift" title="cn/Core_JavaScript_1.5_Reference/Global_
 >Objects/Array/shift">shift</a>
n347            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen347            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/sort">sort</a>>ects/Array/sort" title="cn/Core_JavaScript_1.5_Reference/Global_O
 >bjects/Array/sort">sort</a>
n359            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen359            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/splice">splice</a>>ects/Array/splice" title="cn/Core_JavaScript_1.5_Reference/Global
 >_Objects/Array/splice">splice</a>
n371            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen371            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/unshift">unshift</a>>ects/Array/unshift" title="cn/Core_JavaScript_1.5_Reference/Globa
 >l_Objects/Array/unshift">unshift</a>
n380      Accessor 过程n380      Accessor 方法
n392            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen392            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/concat">concat</a>>ects/Array/concat" title="cn/Core_JavaScript_1.5_Reference/Global
 >_Objects/Array/concat">concat</a>
n404            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen404            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/indexOf">indexOf</a>>ects/Array/indexOf" title="cn/Core_JavaScript_1.5_Reference/Globa
 >l_Objects/Array/indexOf">indexOf</a>
n410            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen410            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/join">join</a>>ects/Array/join" title="cn/Core_JavaScript_1.5_Reference/Global_O
 >bjects/Array/join">join</a>
n422            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen422            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/lastIndexOf">lastIndexOf</a>>ects/Array/lastIndexOf" title="cn/Core_JavaScript_1.5_Reference/G
 >lobal_Objects/Array/lastIndexOf">lastIndexOf</a>
n434            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen434            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/slice">slice</a>>ects/Array/slice" title="cn/Core_JavaScript_1.5_Reference/Global_
 >Objects/Array/slice">slice</a>
435          </dt>
436          <dd>
437            Extracts a section of an array and returns a new arra
>y. 
438          </dd>
439        </dl>
440      </dd>
441    </dl>
442    <dl>
443      <dd>
444        <dl>
445          <dt>435          </dt>
446            <a href="cn/Core_JavaScript_1.5_Reference/Global_Obje436          <dd>
>cts/Array/toSource">toSource</a> 
437            返回数组中的一段。
438          </dd>
439        </dl>
440      </dd>
441    </dl>
442    <dl>
443      <dd>
444        <dl>
445          <dt>
446            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
 >ects/Array/toSource" title="cn/Core_JavaScript_1.5_Reference/Glob
 >al_Objects/Array/toSource">toSource</a>
n458            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen458            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/toString">toString</a>>ects/Array/toString" title="cn/Core_JavaScript_1.5_Reference/Glob
 >al_Objects/Array/toString">toString</a>
459          </dt>
460          <dd>
461            返回代表该数组及其元素的字符,重写<a href="cn/Core_JavaScript_1.5_Refe
>rence/Global_Objects/Object/toString">Object.toString</a> 过程. 
462          </dd>
463        </dl>
464      </dd>
465    </dl>
466    <dl>
467      <dd>
468        <dl>
469          <dt>459          </dt>
470            <a href="cn/Core_JavaScript_1.5_Reference/Global_Obje
>cts/Array/valueOf">valueOf</a> 
471          </dt>460          <dd>
461            返回代表该数组及其元素的字符,重写<a href="/cn/Core_JavaScript_1.5_Ref
 >erence/Global_Objects/Object/toString" title="cn/Core_JavaScript_
 >1.5_Reference/Global_Objects/Object/toString">Object.toString</a>
 > 过程.
472          <dd>462          </dd>
463        </dl>
464      </dd>
465    </dl>
466    <dl>
467      <dd>
468        <dl>
469          <dt>
470            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
 >ects/Array/valueOf" title="cn/Core_JavaScript_1.5_Reference/Globa
 >l_Objects/Array/valueOf">valueOf</a>
471          </dt>
472          <dd>
473            Returns the primitive value of the array. Overrides t473            Returns the primitive value of the array. Overrides t
>he <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/Objec>he <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects/Obje
>t/valueOf">Object.valueOf</a> method.>ct/valueOf" title="cn/Core_JavaScript_1.5_Reference/Global_Object
 >s/Object/valueOf">Object.valueOf</a> method.
n488            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen488            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/filter">filter</a>>ects/Array/filter" title="cn/Core_JavaScript_1.5_Reference/Global
 >_Objects/Array/filter">filter</a>
n500            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen500            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/forEach">forEach</a>>ects/Array/forEach" title="cn/Core_JavaScript_1.5_Reference/Globa
 >l_Objects/Array/forEach">forEach</a>
n512            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen512            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/every">every</a>>ects/Array/every" title="cn/Core_JavaScript_1.5_Reference/Global_
 >Objects/Array/every">every</a>
n524            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen524            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/map">map</a>>ects/Array/map" title="cn/Core_JavaScript_1.5_Reference/Global_Ob
 >jects/Array/map">map</a>
n536            <a href="cn/Core_JavaScript_1.5_Reference/Global_Objen536            <a href="/cn/Core_JavaScript_1.5_Reference/Global_Obj
>cts/Array/some">some</a>>ects/Array/some" title="cn/Core_JavaScript_1.5_Reference/Global_O
 >bjects/Array/some">some</a>
n545      Generic 过程n545      Generic 方法
n551      TODO: give examples with Array.prototype.forEach.call, and n551      TODO: give examples with Array.prototype.forEach.call, and 
>adding the method to an object like <a href="cn/Core_JavaScript_1>adding the method to an object like <a href="/cn/Core_JavaScript_
>.5_Reference/Global_Objects/JavaArray">JavaArray</a> or <a href=">1.5_Reference/Global_Objects/JavaArray" title="cn/Core_JavaScript
>cn/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a>_1.5_Reference/Global_Objects/JavaArray">JavaArray</a> or <a href
>>.>="/cn/Core_JavaScript_1.5_Reference/Global_Objects/String" title=
 >"cn/Core_JavaScript_1.5_Reference/Global_Objects/String">String</
 >a>.
552    </p>
553    <p>552    </p>
554      Some methods, such as <a href="cn/Core_JavaScript_1.5_Refer
>ence/Global_Objects/Array/join">join</a>, only read the <code>len 
>gth</code> and numeric properties of the object they are called o 
>n. Others, like <a href="cn/Core_JavaScript_1.5_Reference/Global_ 
>Objects/Array/reverse">reverse</a>, require that the object's num 
>eric properties and <code>length</code> be mutable; these methods 
> can therefore not be called on objects like <a href="cn/Core_Jav 
>aScript_1.5_Reference/Global_Objects/String">String</a>, which do 
>es not permit its <code>length</code> property or synthesized num 
>eric properties to be set. 
555    </p>553    <p>
554      Some methods, such as <a href="/cn/Core_JavaScript_1.5_Refe
 >rence/Global_Objects/Array/join" title="cn/Core_JavaScript_1.5_Re
 >ference/Global_Objects/Array/join">join</a>, only read the <code>
 >length</code> and numeric properties of the object they are calle
 >d on. Others, like <a href="/cn/Core_JavaScript_1.5_Reference/Glo
 >bal_Objects/Array/reverse" title="cn/Core_JavaScript_1.5_Referenc
 >e/Global_Objects/Array/reverse">reverse</a>, require that the obj
 >ect's numeric properties and <code>length</code> be mutable; thes
 >e methods can therefore not be called on objects like <a href="/c
 >n/Core_JavaScript_1.5_Reference/Global_Objects/String" title="cn/
 >Core_JavaScript_1.5_Reference/Global_Objects/String">String</a>, 
 >which does not permit its <code>length</code> property or synthes
 >ized numeric properties to be set.
556    <p>555    </p>
556    <p>
557      The methods that work on any Array-like object and do <b>no557      The methods that work on any Array-like object and do <stro
>t</b> need to alter <code>length</code> or numeric properties are>ng>not</strong> need to alter <code>length</code> or numeric prop
>:>erties are:
n561        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/n561        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
>Array/concat">concat</a>>/Array/concat" title="cn/Core_JavaScript_1.5_Reference/Global_Obj
 >ects/Array/concat">concat</a>
562      </li>
563      <li>562      </li>
564        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/every">every</a> 
565      </li>563      <li>
564        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/every" title="cn/Core_JavaScript_1.5_Reference/Global_Obje
 >cts/Array/every">every</a>
566      <li>565      </li>
567        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/filter">filter</a> 
568      </li>566      <li>
567        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/filter" title="cn/Core_JavaScript_1.5_Reference/Global_Obj
 >ects/Array/filter">filter</a>
569      <li>568      </li>
570        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/forEach">forEach</a> 
571      </li>569      <li>
570        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/forEach" title="cn/Core_JavaScript_1.5_Reference/Global_Ob
 >jects/Array/forEach">forEach</a>
572      <li>571      </li>
573        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/indexOf">indexOf</a> 
574      </li>572      <li>
573        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/indexOf" title="cn/Core_JavaScript_1.5_Reference/Global_Ob
 >jects/Array/indexOf">indexOf</a>
575      <li>574      </li>
576        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/join">join</a> 
577      </li>575      <li>
576        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/join" title="cn/Core_JavaScript_1.5_Reference/Global_Objec
 >ts/Array/join">join</a>
578      <li>577      </li>
579        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/lastIndexOf">lastIndexOf</a> 
580      </li>578      <li>
579        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/lastIndexOf" title="cn/Core_JavaScript_1.5_Reference/Globa
 >l_Objects/Array/lastIndexOf">lastIndexOf</a>
581      <li>580      </li>
582        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/map">map</a> 
583      </li>581      <li>
582        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/map" title="cn/Core_JavaScript_1.5_Reference/Global_Object
 >s/Array/map">map</a>
584      <li>583      </li>
585        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/slice">slice</a> 
586      </li>584      <li>
585        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/slice" title="cn/Core_JavaScript_1.5_Reference/Global_Obje
 >cts/Array/slice">slice</a>
587      <li>586      </li>
588        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/some">some</a> 
589      </li>587      <li>
588        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/some" title="cn/Core_JavaScript_1.5_Reference/Global_Objec
 >ts/Array/some">some</a>
590      <li>589      </li>
591        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/toSource">toSource</a> 
592      </li>590      <li>
591        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/toSource" title="cn/Core_JavaScript_1.5_Reference/Global_O
 >bjects/Array/toSource">toSource</a>
593      <li>592      </li>
594        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/toString">toString</a> 
595      </li>593      <li>
594        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/toString" title="cn/Core_JavaScript_1.5_Reference/Global_O
 >bjects/Array/toString">toString</a>
596      <li>595      </li>
597        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/596      <li>
>Array/valueOf">valueOf</a> 
597        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/valueOf" title="cn/Core_JavaScript_1.5_Reference/Global_Ob
 >jects/Array/valueOf">valueOf</a>
n605        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/n605        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
>Array/pop">pop</a>>/Array/pop" title="cn/Core_JavaScript_1.5_Reference/Global_Object
 >s/Array/pop">pop</a>
606      </li>
607      <li>606      </li>
608        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/push">push</a> 
609      </li>607      <li>
608        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/push" title="cn/Core_JavaScript_1.5_Reference/Global_Objec
 >ts/Array/push">push</a>
610      <li>609      </li>
611        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/reverse">reverse</a> 
612      </li>610      <li>
611        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/reverse" title="cn/Core_JavaScript_1.5_Reference/Global_Ob
 >jects/Array/reverse">reverse</a>
613      <li>612      </li>
614        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/shift">shift</a> 
615      </li>613      <li>
614        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/shift" title="cn/Core_JavaScript_1.5_Reference/Global_Obje
 >cts/Array/shift">shift</a>
616      <li>615      </li>
617        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/sort">sort</a> 
618      </li>616      <li>
617        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/sort" title="cn/Core_JavaScript_1.5_Reference/Global_Objec
 >ts/Array/sort">sort</a>
619      <li>618      </li>
620        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/
>Array/splice">splice</a> 
621      </li>619      <li>
620        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/splice" title="cn/Core_JavaScript_1.5_Reference/Global_Obj
 >ects/Array/splice">splice</a>
622      <li>621      </li>
623        <a href="cn/Core_JavaScript_1.5_Reference/Global_Objects/622      <li>
>Array/unshift">unshift</a> 
623        <a href="/cn/Core_JavaScript_1.5_Reference/Global_Objects
 >/Array/unshift" title="cn/Core_JavaScript_1.5_Reference/Global_Ob
 >jects/Array/unshift">unshift</a>
t627      This example shows how to use <a href="cn/Core_JavaScript_1t627      This example shows how to use <a href="/cn/Core_JavaScript_
>.5_Reference/Global_Objects/Array/map">map</a> on a <a href="cn/C>1.5_Reference/Global_Objects/Array/map" title="cn/Core_JavaScript
>ore_JavaScript_1.5_Reference/Global_Objects/String">string</a> ob>_1.5_Reference/Global_Objects/Array/map">map</a> on a <a href="/c
>ject to get an array of bytes in the ASCII encoding representing >n/Core_JavaScript_1.5_Reference/Global_Objects/String" title="cn/
>the character values:>Core_JavaScript_1.5_Reference/Global_Objects/String">string</a> o
 >bject to get an array of bytes in the ASCII encoding representing
 > the character values:

返回历史