Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove #119

Open
tjmehta opened this issue Dec 11, 2015 · 4 comments
Open

remove #119

tjmehta opened this issue Dec 11, 2015 · 4 comments

Comments

@tjmehta
Copy link
Owner

tjmehta commented Dec 11, 2015

remove([1,2,3], 1)
remove([1,2,3], equals(1))
@tjmehta tjmehta changed the title Add remove remove Dec 11, 2015
@bkendall
Copy link
Collaborator

optional limit parameter?

remove([1,2,3,1,2,3], 1, 1)
// => [2, 3, 1, 2, 3] only removed the first 1

@cflynn07
Copy link
Contributor

+1 for limit parameter

@cflynn07
Copy link
Contributor

How would you syntactically handle removing a function from any array of functions.

function a () {}
function b () {}
function c () {}
remove([a, b, c], b);

If you invoke b, the response will always be undefined/falsy and nothing will be removed.
If you compare using the equality operator ===, remove([a, b, c], b); // returns [a, c]

@tjmehta
Copy link
Owner Author

tjmehta commented Dec 12, 2015

Nice feedback 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants