> Le 7 févr. 2020 à 13:23, manuelbarzi <[email protected]> a écrit :
> 
> calling it again would just apply the same mechanism => "do this element 
> already exist? "remove it" : "add it". in the example, it would just add 1 at 
> the end of array (i.e. just a push), calling it the second time.

Probably `Array.prototype.remove` would be a more appropriate name for what you 
suggest.

The DOMTokenList array-like interface has such a `remove` method (and some 
others):

https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList 
<https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList>

Although, in situations where I am in a need of a `remove` method, I tend to 
use a Set instead of an Array.

—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to