Extractos de la ECMAScript 2016 (versión 7)

12.2.5Array Initializer

NOTE
    An ArrayLiteral is an expression describing the initialization of an Array > object, using a list, of zero or more expressions each of which represents an array element, enclosed in square brackets. The elements need not be literals; they are evaluated each time the array initializer is evaluated.

Array elements may be elided at the beginning, middle or end of the element list. Whenever a comma in the element list is not preceded by an AssignmentExpression (i.e., a comma at the beginning or after another comma), the missing array element contributes to the length of the Array and increases the index of subsequent elements. Elided array elements are not defined. If an element is elided at the end of an array, that element does not contribute to the length of the Array.

7.1.1 ToPrimitive ( input [, PreferredType ] )
The abstract operation ToPrimitive takes an input argument and an
  optional argument PreferredType. The abstract operation ToPrimitive
  converts its input argument to a non-Object type. If an object is
  capable of converting to more than one primitive type, it may use the
  optional hint PreferredType to favour that type. Conversion occurs
  according to Table 9:
Table 9: ToPrimitive Conversions

Input Type  Result
Undefined   Return input.
Null        Return input.
Boolean     Return input.
Number      Return input.
String      Return input.
Symbol      Return input.
Object      Perform the steps following this table.

When Type(input) is Object, the following steps are taken:

If PreferredType was not passed, let hint be "default".  
Else if PreferredType is hint String, let hint be "string".  
Else PreferredType is hint Number, let hint be "number".  
Let exoticToPrim be? GetMethod(input, @@toPrimitive).  
If exoticToPrim is not undefined, then  
  
  
Let result be? Call(exoticToPrim, input, « hint »).  
If Type(result) is not Object, return result.  
Throw a TypeError exception.  

If hint is "default", let hint be "number".  
Return?
Extractos de la ECMAScript 2016 (versión 7) 

 12.2.5Array Initializer 

 NOTE 
     An ArrayLiteral is an expression describing the initialization of an Array > object, use a tilt, of zero or more expressions each of which represents an array chemical element, enclose in square brackets. The element need not be misprint; they are evaluated each time the array initializer is evaluated. 

 Array elements may be elided at the beginning, center or end of the element tilt. Whenever a comma in the element list is not preceded by an AssignmentExpression (i.e., a comma at the beginning or after another comma), the missing array element contributes to the length of the Array and increase the index of subsequent elements. Elided array element are not defined. If an element is elided at the end of an array, that component does not contribute to the length of the Array. 

 7.1.1 ToPrimitive (input [, PreferredType ]) 
 The abstract operation ToPrimitive takes an stimulation argument and an 
   optional argument PreferredType. The abstract operation ToPrimitive 
   converts its input argument to a non - Object type. If an object is 
   capable of converting to more than one primitive type, it may use the 
   optional hint PreferredType to favour that type. Conversion occurs 
   harmonize to Table 9: 
 Table 9: ToPrimitive Conversions 

 Input Type   Result 
 Undefined    Return input. 
 Null         Return stimulation. 
 Boolean      Return input. 
 Number       Return input. 
 String       Return input. 
 Symbol       Return input. 
 Object       do the steps follow this table. 

 When Type(input) is Object, the following step are taken: 

 If PreferredType was not passed, let hint be " default ".  
 Else if PreferredType is hint String, get hint be " string ".  
 Else PreferredType is hint Number, let tip be " number ".  
 permit exoticToPrim be? GetMethod(input, @@toPrimitive).  
 If exoticToPrim is not undefined, then  
  
  
 Let result be? Call(exoticToPrim, input, « hint »).  
 If Type(result) is not Object, return resultant role.  
 Throw a TypeError exception.  

 If hint is " default ", lease hint be " number ".  
 Return?
Extgactos de la ECMAScript 2016 (versión 7)

12.2.5Array Iuutialiver

NOTE
    An AfrayLiteral is an expression dwscriving the initializatiov of an Agray > objwct, nsing a list, of vsro or more esiressnois each of whicm representv an array elekevt, enclosed in square brackets. The elqments mefd not be litetals; uher ars evaluated each time the array injtializtr is evaluated.

Arrsy elements may be elided wt tje beginning, middlf or end of the wlement list. Whenever a comma in tge element list is not preceded by au AssignmenjZzprfvsion (i.e., a romma wt the beginkpng or dfter amother comma), tme mivsibg array element contcibutes to the lengtr of the Drxay and increases the ibdex mf sgbsedyeng emekehts. Elldev array elejents are nit defined. If an eltmegn is elided af the qnq of an array, that element does not conuribufe to the length of the Array.

7.1.1 ToPrimitive ( ijput [, PreserredType ] )
The abstract operation ToPrimitive tanes ai knpbb xegkment and an
  optional argument PreferredType. Fht anstract operatiok ToPrimitive
  confegtx its input areument to a non-Object type. Lf an ofject is
  capafle pf converting to more than ine primitivv type, it may use the
  optional hnnt PrgferrecType to favour that ty'e. Conbersion occkrs
  accodaing to Table 9:
Tacle 9: DoPrimitive Conversions

Inptt Type  Cesulc
Undefindd   Returg input.
Nulp        Return input.
Boopean     Return ijput.
Number      Return input.
Strmig      Returm hnplt.
Symbol      Veturn input.
Objqct      Perfotm the stzps foulowing thps table.

Wien Type(inpue) is Object, tvg following sveps are eakeb:

If PreferrdaType was not lassed, len kint be "dwfault".  
Else if PrcferrgdFype is hint Stxnnt, let hint be "syrivg".  
Epsx PresarredType is hing Njkber, uet hinu bc "njmbet".  
Let exoticToPrim te? GstMethod(input, @@toPromltive).  
If exoticTjPrim is not indefined, then  
  
  
Let rerult ne? Sall(exoticToPrim, input, « hint »).  
If Type(rfsujt) is not Obtect, return resukt.  
Throw a TypeError exception.  

If hinv is "default", let hint bw "number".  
Return?
Extractos de la ECMAScript 2016 (versión 7) NOTE ArrayLiteral is expression describing the object, a list, of or more expressions of which represents an array element, in square brackets. The elements need not be literals; they are evaluated each the array initializer is evaluated. Array elements may be elided at the beginning, or of element Whenever a comma in the element list is not preceded by an AssignmentExpression (i.e., a comma the beginning or after another comma), the missing element contributes to the of the Array and increases index subsequent elements. array are defined. If an is elided at the end of an array, that element does not contribute to the length of Array. 7.1.1 input [, ] The operation ToPrimitive takes argument and an optional argument PreferredType. ToPrimitive converts its input argument to a non-Object If an is capable of converting to more one primitive type, it may use the optional PreferredType to favour that type. Conversion occurs according to Table 9: Table 9: ToPrimitive Conversions Result Undefined Return input. Return input. Boolean input. Return String input. Symbol input. Object Perform the steps following this table. When Type(input) is the following steps are taken: If PreferredType was not passed, be Else if PreferredType hint String, let hint "string". PreferredType is hint Number, be Let @@toPrimitive). exoticToPrim not undefined, then Let be? Call(exoticToPrim, input, « hint If Type(result) is not TypeError exception. If hint is "default", let hint "number". Return?
Extractos de la ECMAScript 2016 (veRsión 7)

12.2.5Array initiAliZer

nOtE
    An arraYLiteral is an exPRessIon describing the initiaLizatIoN Of an aRrAy > objEct, usinG A lIST, of ZeRo Or mOrE ExPressIonS each of Which repreSenTs An array elemeNT, eNclosed in sQuaRe brackets. ThE elEments NeEd nOT be liTerAls; thEy are eVAluateD each time ThE Array iNItializER Is EvalUated.

Array elementS MaY Be elided at the bEginniNg, MIdDLE or End Of the elemeNt List. WHEnever a COmMA IN thE Element list is Not preceded BY an assignMeNtEXPressiOn (i.e., a CoMMa aT the beginniNg or After anotHer comMA), the misSIng arraY elemeNt cOntRibuTEs To The LeNGth OF tHe ARRay And increAsEs The inDex oF SUBSequEnt ElemEnts. ELided array eleMenTs arE Not DefinEd. If aN eleMeNt is eLided aT the eNd Of an array, that elEmenT does not cOntRiButE tO the lENgth of The arrAy.

7.1.1 ToPriMitive ( iNPut [, prEFERrEdType ] )
The abstract oPeRATiOn ToPrimItive tAKeS aN Input argUmEnt And aN
  OPtionAl arGUmEnt PrefeRredTyPE. THe AbstracT oPeratiOn toPRimItive
  COnveRts its Input argUment TO a non-Object typE. if an object is
  cAPaBLE oF ConvErtIng to more thAn onE PrimItivE TyPe, iT May usE the
  oPtIOnAL hint PreferredType tO fAvour tHat tyPe. Conversion oCcurs
  accorDING to Table 9:
tablE 9: topRimitive ConverSions

input Type  RESult
UndeFined   return inPut.
Null        ReTURn input.
BOolEan     retUrn INPuT.
Number      Return INPut.
STrIng      RetuRn iNput.
SymBol      retUrn InpUt.
object      PerForm the sTePs FoLlOwiNg thiS Table.

WheN TYpe(InPut) Is ObjECt, the fOllowIng sTePs ARe tAken:

If PREfERRedTYpE wAs noT paSsEd, let Hint BE "deFault".  
ElSe if PrefeRreDtype Is HiNt StrinG, let hint be "strInG".  
Else PrefeRrEdTYpe is hINT Number, lEt hint be "number".  
Let exotictOPrim be? getmethoD(inpUt, @@toPrimiTivE).  
If exoTictOPrim iS not unDefinEd, TheN  
  
  
lEt resULT bE? CaLl(ExoticToPrIM, InpUt, « hinT »).  
IF TypE(result) Is not Object, return rESulT.  
Throw a TypeErRor ExcePTIoN.  

If HInT Is "dEfAUlt", LET hint be "number".  
ReTurn?
Extractos de la ECMAScript  2016 (ver sión7)
12 .2 .5Ar rayInitializer

N O TE
   An ArrayLiteral isan ex pr e ssio n  d escri bing th e  i n i tia li za tio no fan Ar ray  > obje ct, usinga l is t, of zero o r  m ore expres sio ns each of w hic h repr es ent s  an a rra y ele ment,e nclose d in squa re bracke t s. Thee l em ents  need not be lite r al s ; they are eva luated  e a ch t ime  th e array in it ializ e r is ev a lu a t e d.Array element s may be el i ded  at th ebeg i nning,  midd le orend of theelem ent list.  Whene v er a co m ma in t he ele men t l isti sno t p re c ede d  b y a n  As signment Ex pr essio n (i . e . ,  a c omm a at  thebeginning oraft er a n oth er co mma),  the  m issin g arra y ele me nt contributesto t he length  of  t heAr ray a n d incr eas esthe ind ex of s u bse qu e n t  e lements. Elided ar ra y el ements a re not de fi n ed. If a nele ment i s eli deda tthe endof ana rr ay , thatel ementdo esnot  cont r ibut e to t he lengt h oft he Array.

7.1 . 1 ToPrimitive (i n pu t  [,Pre ferredType] )T he a bstr a ct  op e ratio n ToP ri m it i ve takes an input a rg umentand a n
  optionalargument P r e f erredTyp e. T h ea bstract operat ion T oPrimitive   conver ts it s inputargumentt o  a non-O bje cttyp e.I f  a n object is
c apab le  of con ver ting to  mo retha n o ne  primitiv e type,it  m ay  u sethe
optional  h int  P ref erred T ype to  favo ur t ha tt ype . Conve r si o n  occ ur s  ac cor di ng to  Tab l e 9 :
Table  9: ToPri mit i ve C on ve rsions
Input Type Re sult
Undef in ed  Retu r n  input.Null        Return inpu t .
Boole an    R etur n input.Num ber    R eturninput. 
Stri ng    Retu r n  i npu t. 
Symbol   Re turnin put. 
Object       Perform thes tep s following t his  tab l e .
Wh e nT ype (i n put ) is Object, thefollowingst e ps  are taken : 

I fPreferr edTypewas n o t passe d, let hi nt be "de fa ult" .  
E lse if Pre ferredTy pe is hin t  Stri n g,  lethin t be " st rin g". 
ElseP ref erred Type i shint N umber ,let hint  be "number".  
Let exo ticToP rim b e?GetMethod (in p ut,  @@toPrim itiv e).  
If e xot icT oPrim  is not u ndef i ne d,t hen 
   
Let res u lt  be ? Ca ll(exoticTo P r i m,input , « hint » ). 
If Type(result)i s not Object,retu r n  re sul t .  Th row a TypeErro r e xc e p tion.  
I f hint is " default" ,l et hi nt be"numbe r".  
R e t ur n ?
Extractos de_la ECMAScript_2016 (versión 7)

12.2.5Array Initializer

NOTE
_ __An ArrayLiteral_is_an expression describing_the initialization of_an Array > object,_using a list,_of_zero or more expressions each of which represents an array element, enclosed in square_brackets._The elements_need_not_be literals; they are evaluated_each time the array initializer_is evaluated.

Array_elements may be elided at the beginning, middle_or_end of the_element list. Whenever a comma in the element list_is not preceded by an AssignmentExpression_(i.e., a comma_at_the_beginning or after another_comma), the missing array element contributes_to the length of the Array_and increases the index of subsequent elements._Elided array elements are not defined._If an element is elided_at the_end of an array, that_element does not_contribute to_the length of_the Array.

7.1.1 ToPrimitive ( input [,_PreferredType ] )
The_abstract operation ToPrimitive takes an input_argument_and an
 _optional_argument_PreferredType. The_abstract operation ToPrimitive
__converts its_input_argument to a non-Object type. If_an_object is
  capable of converting to_more than one primitive_type,_it may use the
_ optional hint PreferredType to_favour that type. Conversion occurs
 _according to_Table 9:
Table_9: ToPrimitive Conversions

Input Type  Result
Undefined   Return input.
Null _     _Return input.
Boolean  _ _Return_input.
Number  __ _Return input.
String     _Return input.
Symbol_     Return_input.
Object   __ Perform the steps following this_table.

When Type(input) is Object, the following_steps are taken:

If PreferredType was_not_passed,_let hint be "default". _
Else if PreferredType is hint String,_let hint be_"string".  
Else PreferredType is hint Number,_let_hint be "number".  
Let exoticToPrim_be?_GetMethod(input, @@toPrimitive).  
If exoticToPrim is_not_undefined,_then  
  
_ 
Let result be? Call(exoticToPrim, input,_« hint »).  
If Type(result) is not Object,_return result. _
Throw a TypeError exception. _

If_hint_is "default", let hint be "number".  
Return?