es6-04- extended operator function with the solution of the arrow

1, extended operator:

<Script> 
        // ... extended operator 
        // 1, the non-array into an array (i.e. an array of class has attributes length) 
        // 2, the array into an array of non- 

        // 1, the non-array into an array (i.e., the array has a length property class of) 
        the let STR = '123'; 
        the console.log ([STR ...]); 

        function F () { 
            the console.log ([arguments ...]); 
        } 
        F (. 1, 12,369); 

        function F1 (Arg ...) { 
            the console.log (Arg); 
        } 
        F1 (10,20,30); 

        // 2, the array into an array of non- 
        let a1 = [1,2,3,4 , 5,6]; 
        the let A2 = [7,8,9,]; 
        the console.log (a1.concat (A2)); // direct connection 

        console.log ([... a1, ... a2 ]) ; // Deconstruction together, first into an array of non-array

        console.log (Math.max (... a1)) ; // deconstruction array, the array becomes non-array, and then call the method takes a maximum value 

        console.log (... a1); // deconstruction array output, 2. 6. 5. 4. 3. 1 
</ Script>

2, arrows functions:

Guess you like

Origin www.cnblogs.com/gzwzx/p/12016232.html