Is there any method to push object to array uniquely with 1 method by ES6 ?
For Ex:
MyArray.pushUniquely(x);
Or good to use old version like ? :
MyMethod(x) {
if ( MyArray.IndexOf(x) === -1 )
MyArray.Push(x);
}
Is there any method to push uniquely by ES6 ?