question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Equivalent of _.without

See original GitHub issue

Hi,

Is there an elegant way to remove an item from an array in an immutable way without using underscore?

I want _.without([1,2,3],2) to return [1,3].

The original array should remain unmodified.

I’d like to avoid using a syntax involving indexes, slice, splice or whatever because I never remember it and using _ is much simpler.

Is there any simple way with ES next?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
slorbercommented, Mar 17, 2016

lol i think i’ll keep using lodash for now 😃

1reaction
AndreasHassingcommented, Jul 1, 2016

@slorber wouldn’t this work as wanted: [1, 2, 3].without(2);?

Edit: Oh, I get it… You want to be able to do: [1, 2, 3].without([1, 2]);, right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Without Synonyms & Antonyms
withoutpreposition. Synonyms: with no, wo, lacking, sans, -less, outwith · withoutpreposition. Unless, except (introducing a clause). Synonyms: -less, wo, ...
Read more >
synonyms for without equal - Thesaurus.com
synonyms for without equal · peerless · unmatched · unparalleled · unrivaled · unsurpassed · alone · beyond compare · incomparable ...
Read more >
81 Synonyms & Antonyms of EQUIVALENT - Merriam-Webster
Synonyms for EQUIVALENT: counterpart, equal, like, parallel, partner, fellow, rival, colleague; Antonyms of EQUIVALENT: other, different, unlike, ...
Read more >
Synonyms for without | Similar, equivalent words for without ...
Synonyms for without. What words can replace the word “without”? Words which starts from letter “w” of 7 letters. The best online synonym...
Read more >
What is another word for "without equal"? - WordHippo
What is another word for without equal? ; perfect · outstanding ; beyond compare · unequalled ; unmatched · unequaled ; unsurpassed ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found