We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm looking for something like this :
myObject = _.zipToObject([a, b, c], function () { return makeObject() }); // myObject -> { a: [Object], b: [Object], c: [Object] };
IE, it creates an object whose keys are taken from the array, and for each key, the value is set by a callback.
The text was updated successfully, but these errors were encountered:
You can combo _.map or _.times and _.zipObject:
_.map
_.times
_.zipObject
_.zipObject(keys, _.map(keys, function() { }));
Sorry, something went wrong.
I've created #2718 which solves the above problem in a much more generic way
https://stackoverflow.com/a/45687156/8202629
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
I'm looking for something like this :
IE, it creates an object whose keys are taken from the array, and for each key, the value is set by a callback.
The text was updated successfully, but these errors were encountered: