Skip to content

Instantly share code, notes, and snippets.

@franz899 franz899/assign.js
Last active Nov 4, 2016

Embed
What would you like to do?
Lodash vs Ramda vs ES6
'use strict';
var _ = require('lodash');
var R = require('ramda');
var obj1 = {
a:1,
b:1,
}
var obj2 = {
a:undefined,
b:20,
c:30
}
var obj3 = {
a: 100
}
let objES6 = Object.assign({}, obj1, obj2, obj3);
let objLodash = _.merge({}, obj1, obj2, obj3); // Lodash
let objRamda = R.mergeAll([{}, obj1, obj2, obj3]) // Ramda
console.log('ES6 ',objES6);
console.log('Lodash ',objLodash);
console.log('Ramda ',objRamda);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.