📅  最后修改于: 2022-03-11 15:01:43.552000             🧑  作者: Mango
//create an new function that can be used by any array
Array.prototype.second = function() {
return this[1];
};
var myArray = ["item1","item2","item3"];
console.log(myArray.second());//returns 'item2'