📜  数组原型 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:02.638000             🧑  作者: Mango

代码示例1
Array.prototype.myUcase = function() {
  for (i = 0; i < this.length; i++) {
    this[i] = this[i].toUpperCase();
  }
};
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.myUcase();
console.log(fruits)