How to remove duplicates from an array of objects using JavaScript ?