function square(arr) {
            //for
            //let res=arr;
            //for(let i=0;i<arr.length;i++){
            //    res[i]=Math.pow(arr[i],2)
            //}

            //for of
            //let res=[]
            //for(let num of arr){
            //    res.push(Math.pow(num,2))
            //}
            //return res;

            //forEach
            //let res=[]
            //arr.forEach(num=>{
            //    res.push(Math.pow(num,2))
            //})
            //return res;

            //map最简洁
            return arr.map(num=>Math.pow(num,2))