title: How to add property to existing object on JavaScript/React
body: <p>I'm fetching data from API and i would like to add property to my object.
  I'm currently adding image property but i need to add this one layer deeper inside object.</p>
  <p>Could you give me a hint how to achieve that?</p>
  <p>I have stuck on this moment:
  <a href="https://i.stack.imgur.com/Fo7Xe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fo7Xe.png" alt="enter image description here" /></a></p>
  <p>My code:</p>
  <pre><code>const Review = () =&gt; {
    const url = &quot;https://jsonplaceholder.typicode.com/users&quot;;
  
    const [people, setPeople] = useState(null);
  
    const fetchPeople = async () =&gt; {
      try {
        const response = await fetch(url);
        const data = await response.json();
  
        let test = Object.entries(data).map((people) =&gt; ({
          ...people,
          image: &quot;image url goes here&quot;,
        }));
        setPeople(test);
      } catch (error) {
        console.error(error);
      }
    };
  
    useEffect(() =&gt; {
      fetchPeople();
      console.log(people);
    }, []);
  </code></pre>