Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -0,0 +1,10 @@
// single-sided
Array.prototype.simpleSMA=function(N) {
return this.map(function(x,i,v) {
if(i<N-1) return NaN;
return v.filter(function(x2,i2) { return i2<=i && i2>i-N; }).reduce(function(a,b){ return a+b; })/N;
}); };
g=[1,2,3,4,5,8,5,4];
console.log(g.simpleSMA(3))
console.log(g.simpleSMA(5))