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

Please briefly mention at top of Readme whether it merges right to left or left to right. #115

Closed
codekiln opened this issue Apr 5, 2019 · 2 comments

Comments

@codekiln
Copy link

codekiln commented Apr 5, 2019

Please include a comment in the readme intro indicating whether it merges arguments from right to left or from left to right. It is not currently obvious which object will "win" if they have the same keys.

@codekiln codekiln changed the title Docs: please mention Docs: please briefly mention at top of Readms whether it merges right to left or left to right. Apr 5, 2019
@codekiln codekiln changed the title Docs: please briefly mention at top of Readms whether it merges right to left or left to right. Docs: please briefly mention at top of Readme whether it merges right to left or left to right. Apr 5, 2019
@codekiln codekiln changed the title Docs: please briefly mention at top of Readme whether it merges right to left or left to right. Please briefly mention at top of Readme whether it merges right to left or left to right. Apr 5, 2019
@bebraw
Copy link
Member

bebraw commented Apr 5, 2019

Hi,

Can you give a small example of what you have in mind? I'll add something based on that.

@codekiln
Copy link
Author

I'm picturing something like this:

// Please note that where keys match, the objects to the right take precedence 
var output = merge({fruit: "apple", color: "red"}, {fruit: "strawberries"});
console.log(output);
// { color: "red", fruit: "strawberries"}

@bebraw bebraw closed this as completed in ad2f92a Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants