How can I update an object in an array in JavaScript, like changing a specific property based on a condition?

If you want to stay immutable like in collaborative environments where state is shared (e.g., React or Redux) use .map() to create an updated copy:

const updatedProjects = projects.map(project => 
  project.value === "jquery-ui"
    ? { ...project, desc: "Updated in a new array!" }
    : project
);

This helps avoid side effects and works well when you and your team want safe, predictable updates without modifying the original array.