I have an array grouping. My array value is
var arr = [ 'One', 'One', 'Two', 'Three', 'Two' ];
I want the array's value to be
arr = [ 'One', 'Two', 'Three' ];
How do I group by array value?
I have an array grouping. My array value is
var arr = [ 'One', 'One', 'Two', 'Three', 'Two' ];
I want the array's value to be
arr = [ 'One', 'Two', 'Three' ];
How do I group by array value?
You can use a solution like the one I've built for you in this fiddle. You could also use the uniq
function from underscore. However, my advice to you is to:
This way you are likely to not only solve the problem, but also to grow as a programmer.
Welcome to StackOverflow!