SOURCE


var Arr = ['你','好','呀','!'];

// Arr = []
// Arr.length = 0;
// Arr.splice(0);
while (Arr.length > 0) {
    Arr.pop();
}

console.log(Arr)





// let replaceIndex = Arr.indexOf("呀");
 
// if (replaceIndex > -1) {
//     Arr[replaceIndex] = "哦";
// }
// console.log(Arr)


// var Arr = ['你','好','呀','!'];
// var reversedArrs = Arr.reverse();
// console.log('原数组��',Arr); 
// console.log('新数组��',reversedArrs); 




// var nums = [1, 5, 2, 6];
// var sum = nums.reduce((x, y) => x + y);
// console.log(sum);


// var nums = [1, 5, 2, 6, 3, 5, 2, 3, 6, 5, 2, 7];
// var lastIndex = nums.lastIndexOf(5);
// console.log('lastIndex��',lastIndex); 

// var Arr = ['你','好','呀','!'];
// var ArrItem = Arr[(Math.floor(Math.random() * (Arr.length)))]

// console.log('随机值��',ArrItem); 

// var mixedArr = [0, "A", "", NaN, 9, true, undefined, "B", false];
// var trueArr = mixedArr.filter(Boolean);
// console.log(trueArr); 

// var numOne = [0, 2, 4, 6, 8, 8];
// var numTwo = [1, 2, 3, 4, 5, 6];
// var duplicatedValues = [...new Set(numOne)].filter(item => numTwo.includes(item));
// console.log(duplicatedValues);


// var arr1 = ['你','好','呀','!'];
// var arr2 = [1,2,3];
// var arr3 = ['Hi','Axjy'];

// var arr = [...arr1,...arr2,...arr3]

// console.log(arr);

// var newArray = new Array(5).fill("Axjy");
// console.log(newArray);

// var arr = ['你','好','呀','!'];
// var arrObj = { ...arr };

// console.log(arrObj);




// var friends = [
//     { name: 'John', age: 22 },
//     { name: 'Peter', age: 23 },
//     { name: 'Mark', age: 24 },
//     { name: 'Maria', age: 22 },
//     { name: 'Monica', age: 21 },
//     { name: 'Martha', age: 19 },
// ]

// var friendsNames = Array.from(friends, ({name}) => name);
// console.log(friendsNames); 


// var arr1 = [1,2,2,3,4,'Axjy','Axjy'];
// arr1.splice(0, 2, "Hi", "good");
// console.log('arr1结果��',arr1); 

// var arr2 = [1,2,2,3,4,'Axjy','Axjy'];
// arr2.splice(-1, 2, "Hi", "good");
// console.log('arr2结果��',arr2); 


// var uniqueArr = Array.from(new Set(arr));
// console.log('方案一��',uniqueArr); 

// var uniqueArr2 = [...new Set(arr)];
// console.log('方案二��',uniqueArr2);



















console 命令行工具 X clear

                    
>
console