简单教程
提交运行
代码编辑器:
<script> Array.prototype.myUcase=function(){ for (i=0;i<this.length;i++){ this[i]=this[i].toUpperCase(); } } function myFunction(){ var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.myUcase(); document.write( fruits ); } myFunction(); </script>
运行结果: