JSFiddle - React, Tailwind, and code Playground

by 420

JavaScript

const a = [
	{firstname: "sanjog", lastname: "shrestha"},
  {firstname: "sujan", lastname: "shrestha"}
]

const b = [...a, {...a[1], firstname: "sagun"}]

console.log(a)