prototype to expand the array dimensionality reduction method borrowed from an array of objects

Principle: As long as an object, he had a prototype prototype object, save the properties and methods have in common.




        
            join ( ','). split ( ',') according to the first, converted to a string, and then by, into an array. 
            arrTemp.push (result_str1)
             return arrTemp; 
        } 
        of arr1 = [. 1, [l, 3], 2 ]; 
        the console.log (arr1.flatten ())

     </ Script> 
</ body> 

</ HTML>

 

Guess you like

Origin www.cnblogs.com/gzw-23/p/11746798.html