UNPKG

forgetsy-js

Version:

Forgetsy.js is a scalable trending library designed to track temporal trends in non-stationary categorical distributions. NodeJS fork of https://github.com/cavvia/forgetsy.

14 lines (12 loc) 242 B
exports.filter = function(arr, filters) { var tmp = []; var len = arr.length; for(var i=0; i<len; i++) { if (filters[arr[i]]) { i+=1; } else { tmp.push({item: arr[i], score: arr[++i]}); } } return tmp; };