?? array.html
字號:
</TR> <TR> <TD VALIGN=TOP><A NAME="1193226"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline>index</zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193228"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>A read-only property that is the zero-based index of the match in the string.</ztabletext></FONT> </TD> <TD VALIGN=TOP><P><A NAME="1193230"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>1</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193232"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline>[0]</zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193234"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>A read-only element that specifies the last matched characters.</ztabletext></FONT> </TD> <TD VALIGN=TOP><P><A NAME="1193236"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>dbBd</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193238"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline>[1], ...[n]</zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193240"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Read-only elements that specify the parenthesized substring matches, if included in the regular expression. The number of possible parenthesized substrings is unlimited.</ztabletext></FONT> </TD> <TD VALIGN=TOP><P><A NAME="1193242"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>[1]=bB <br>[2]=d</ztabletext></FONT> </TD> </TR></TABLE><P></FONT><P><BR><A NAME="1193244"> </A><A NAME="Backward Compatibility"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><zrefheader>Backward Compatibility</zrefheader></B></FONT><BR><P><A NAME="1193245"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><zheadrunin>JavaScript 1.2. </zheadrunin></B></FONT><A NAME="1193246"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>When you specify a single parameter with the <FONT FACE="courier, couriernew, monospaced size">Array</FONT> constructor, the behavior depends on whether you specify <FONT FACE="courier, couriernew, monospaced size">LANGUAGE="JavaScript1.2"</FONT> in the <FONT FACE="courier, couriernew, monospaced size"><SCRIPT></FONT> tag:</zparagraph></FONT><P><ul><A NAME="1193247"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B> <li></B><zsmartlist1>If you specify <FONT FACE="courier, couriernew, monospaced size">LANGUAGE="JavaScript1.2"</FONT> in the <FONT FACE="courier, couriernew, monospaced size"><SCRIPT></FONT> tag, a single-element array is returned. For example, <FONT FACE="courier, couriernew, monospaced size">new Array(5)</FONT> creates a one-element array with the first element being 5. A constructor with a single parameter acts in the same way as a multiple parameter constructor. You cannot specify the <FONT FACE="courier, couriernew, monospaced size">length</FONT> property of an <FONT FACE="courier, couriernew, monospaced size">Array</FONT> using a constructor with one parameter.</zsmartlist1></FONT><P><A NAME="1193248"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B> <li></B><zsmartlist1>If you do not specify <FONT FACE="courier, couriernew, monospaced size">LANGUAGE="JavaScript1.2"</FONT> in the <FONT FACE="courier, couriernew, monospaced size"><SCRIPT></FONT> tag, you specify the initial length of the array as with other JavaScript versions.</zsmartlist1></FONT><P></ul><P><A NAME="1193249"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><zheadrunin>JavaScript 1.1 and earlier. </zheadrunin></B></FONT><A NAME="1193251"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>When you specify a single parameter with the <FONT FACE="courier, couriernew, monospaced size">Array</FONT> constructor, you specify the initial length of the array. The following code creates an array of five elements:</zparagraph></FONT><P><A NAME="1193252"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline>billingMethod = new Array(5)</zcodeline></FONT><P><P><A NAME="1193253"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><zheadrunin>JavaScript 1.0. </zheadrunin></B></FONT><A NAME="1193254"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph>You must index an array by its ordinal number; for example <FONT FACE="courier, couriernew, monospaced size">myArray[0]</FONT>.</zparagraph></FONT><P><BR><A NAME="1193255"> </A><A NAME="Property Summary "> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><zrefheader>Property Summary </zrefheader></B></FONT><BR><A NAME="1193289"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph><BR><P><TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0"> <CAPTION></CAPTION><P><FONT FACE=""><B></B></FONT><BR><BR> <TR BGCOLOR="#CCCCCC" ALIGN=LEFT VALIGN=TOP> <TH VALIGN=TOP ALIGN=LEFT><A NAME="1193258"> </A><P ALIGN="LEFT"><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><ztablehead>Property</ztablehead></B></FONT></TH> <TH VALIGN=TOP ALIGN=LEFT><A NAME="1193260"> </A><P ALIGN="LEFT"><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><ztablehead>Description</ztablehead></B></FONT></TH> </DIV></TR> <TR> <TD VALIGN=TOP><A NAME="1206419"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1206131" >constructor</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1206421"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Specifies the function that creates an object's prototype.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193265"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193399" >index</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193267"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>For an array created by a regular expression match, the zero-based index of the match in the string.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193272"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193419" >input</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193274"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>For an array created by a regular expression match, reflects the original string against which the regular expression was matched.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193279"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193439" >length</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193281"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Reflects the number of elements in an array.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1206003"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1205871" >prototype</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1206005"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Allows the addition of properties to all objects.</ztabletext></FONT> </TD> </TR></TABLE><P></zparagraph></FONT><P><BR><A NAME="1193290"> </A><A NAME="Method Summary"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><zrefheader>Method Summary</zrefheader></B></FONT><BR><A NAME="1193380"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><zparagraph><BR><P><TABLE WIDTH="90%" BORDER="1" CELLPADDING="5" CELLSPACING="0"> <CAPTION></CAPTION><P><FONT FACE=""><B></B></FONT><BR><BR> <TR BGCOLOR="#CCCCCC" ALIGN=LEFT VALIGN=TOP> <TH VALIGN=TOP ALIGN=LEFT><A NAME="1193293"> </A><P ALIGN="LEFT"><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><ztablehead>Method</ztablehead></B></FONT></TH> <TH VALIGN=TOP ALIGN=LEFT><A NAME="1193295"> </A><P ALIGN="LEFT"><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><B><ztablehead>Description</ztablehead></B></FONT></TH> </DIV></TR> <TR> <TD VALIGN=TOP><A NAME="1193300"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1194827" >concat</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193302"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Joins two arrays and returns a new array. </ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193307"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1195456" >join</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193309"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Joins all elements of an array into a string.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193314"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1196003" >pop</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193316"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Removes the last element from an array and returns that element.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193321"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1196550" >push</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193323"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Adds one or more elements to the end of an array and returns the new length of the array.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193328"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193641" >reverse</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193330"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Transposes the elements of an array: the first array element becomes the last and the last becomes the first.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193335"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193677" >shift</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193337"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Removes the first element from an array and returns that element.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193342"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193713" >slice</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193344"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Extracts a section of an array and returns a new array.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193349"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193766" >splice</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193351"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Adds and/or removes elements from an array.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193356"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1196882" >sort</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193358"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Sorts the elements of an array.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193363"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193889" >toSource</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193365"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Returns an array literal representing the specified array; you can use this value to create a new array. Overrides the <A HREF="object.html#1193320" >Object.toSource</A> method.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193370"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193921" >toString</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193372"> </A><FONT FACE="Arial, Helvetica, sans-serif" SIZE="2"><ztabletext>Returns a string representing the array and its elements. Overrides the <A HREF="object.html#1193350" >Object.toString</A> method.</ztabletext></FONT> </TD> </TR> <TR> <TD VALIGN=TOP><A NAME="1193377"></A><FONT FACE="courier, couriernew, monospaced size" SIZE="2"><zcodeline><A HREF="array.html#1193964" >unshift</A></zcodeline></FONT><P> </TD> <TD VALIGN=TOP><P><A NAME="1193379"> </A>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -