JSFiddle - React, Tailwind, and code Playground

JavaScript

function extend(target) {
    var sources = [].slice.call(arguments, 1);
    sources.forEach(function (source) {
        for (var prop in source) {
            target[prop] = source[prop];
        }
    });
    return target;
}

var x = { test: 1},
    y = { other: 2 }

console.log(extend({}, x, y ));