1. Array.prototype.push = function(){
    2. console.log(“失效了”);
    3. }
    4. var arr = [];
    5. arr.push4);
    6. console.logarr);
    7. Array.prototype.remove = functionval){
    8. var index = this.indexOfval);
    9. this.spliceindex,1);
    10. return this;
    11. }
    12. var arr = [5,6,7];
    13. console.logarr.remove6))
    14. //sum
    15. Array.prototype.sum = function(){
    16. var s = 0;
    17. forvar i = 0;i<this.length;i++){
    18. s+=this[i];
    19. }
    20. return s;
    21. }
    22. var test = [1,2,3];
    23. console.logtest.sum())