我想用一个名为square()的新方法扩展Array,该方法返回一个包含所有数字平方的新数组。我试过这样做,但是我想不出函数不接受任何参数的方法,比如默认的JS方法。例如,array.reverse()返回反转的数组--它不接受数组作为参数,如下所示:array.reverse(array) --这是我的代码:
Array.prototype.square = function
我正在尝试向jquery注入一种新方法。基本上,我有一个从jQuery最小文件加载的datepicker。现在,每当加载这个datepicker时,我想注入一个新方法dateCompliance()。what I want to load along with datepicker everytime it loads. this is coming from another datecode.js