JSFiddle - React, Tailwind, and code Playground

by manoj_antony32

JavaScript

"use strict";
function updateTodo(todo, fieldsToUpdate) {
    return Object.assign(Object.assign({}, todo), fieldsToUpdate);
}
const todo1 = {
    title: "organize desk",
    description: "clear clutter",
};
const todo2 = updateTodo(todo1, {
    description: "throw out trash",
});

console.log(todo2)