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

Assign extendOwn #2070

Merged
merged 1 commit into from
Feb 20, 2015
Merged

Conversation

jridgewell
Copy link
Collaborator

“assign” is an ES6 standard, and naming should match it. Any dev who remotely follows ES will immediately recognize and understand what it does.

Aliases _.assign to _.extendOwn, for 1.8.0 compatibility.

Re: #2061, 4f771e0

“assign” is an ES6 standard, and naming should match it. Any dev who
remotely follows ES will immediately recognize and understand what it
does.

Aliases `_.assign` to `_.extendOwn`, for 1.8.0 compatibility.
michaelficarra added a commit that referenced this pull request Feb 20, 2015
@michaelficarra michaelficarra merged commit 6dff42a into jashkenas:master Feb 20, 2015
@jashkenas
Copy link
Owner

Whoa there folks. extendOwn is a nicer name alongside extend. We can add an assign alias — but let's use extendOwn as the primary documented name, and internally.

@jridgewell
Copy link
Collaborator Author

let's use extendOwn as the primary documented name, and internally.

I strongly disagree. I'm not sure why we're actively discouraging ES6 compatibility, but keeping the two in sync is an awesome win.

@jashkenas
Copy link
Owner

ES6 is going to very soon — at least for simple things like assign — be viable. If you want to use Object.assign, just use it. If we can improve on it, let's improve on it. One of the important areas where we can improve on things is naming — a more internally consistent Underscore API is nicer than a franken-Under-ES6-score one.

@jamiebuilds
Copy link
Contributor

The ideal API in my opinion would be for _.assign to behave like Object.assign and for _.extend to be an alias of _.assign. I don't see a need for the _.keysIn version of an assign method (other than for compatibility).

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

Successfully merging this pull request may close these issues.

4 participants