Function to remove ducplicates from array using reduce.
Array.prototype.removeDuplicates = function(){ return this.reduce((result,nextItem)=>result.includes(nextItem) ? result : result.concat(nextItem),[]); }