Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- function uniqObjs( arr ) {
- let uniques = [];
- return _.filter( arr, ( a ) => {
- if( _.indexOf( uniques, JSON.stringify(a) ) === -1 ){
- uniques.push( JSON.stringify(a) );
- return true;
- }
- return false;
- });
- }
- _.mixin({ 'uniqObjs': uniqObjs });
Advertisement
Add Comment
Please, Sign In to add comment