App-MFILE-WWW
view release on metacpan or search on metacpan
share/js/core/lib.js view on Meta::CPAN
// eliminate duplicates from array - use only for arrays containing
// similar primitives (e.g. arrays of numbers, arrays of zip codes, etc.)
// Credits to: https://stackoverflow.com/questions/9229645/remove-duplicates-from-javascript-array
uniq: function (a) {
var seen = {};
return a.filter(function(item) {
return seen.hasOwnProperty(item) ? false : (seen[item] = true);
});
},
// pause main thread for n milliseconds
//wait: function (ms) {
// var start = new Date().getTime();
// var end = start;
// while(end < start + ms) {
// end = new Date().getTime();
// }
//},
};
( run in 0.978 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )