JSFiddle - React, Tailwind, and code Playground
JavaScript
var arr = {
title: "Obect",
elements: [
{ id: 1, title: "Element 1" },
{ id: 2, title: "Element 2" }
]
};
function processElement(item) {
item = { id: 999, title: "New Item" };
}
processElement(arr.elements[1]);
console.log(arr);