JSFiddle - React, Tailwind, and code Playground

by Pratik Galoria

HTML

<script src="https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js"></script>

Babel + JSX

const defaultConfig = {a: 1, b: {b1: 2, b2: {b21: 3}}, c: 4};
const chartConfig = {b: {b2: {b21: 4}, b3: 5}, c: 6};

console.log('Merging with Spread Operator:');
console.log({...defaultConfig, ...chartConfig});

console.log('Using lodash merge');
console.log(_.merge(defaultConfig, chartConfig));