Two problems:
1) Your
arr.push
call needs to use round brackets rather than square brackets:
arr.push({name:guest_name, number: person_number});
2) The object you've added to the array has properties called
name
and
number
, so you can't refer to the non-existent properties
guest_name
and
guest_number
. You need to use the correct property names:
guest_in.innerHTML = `Guest's name: ${arr[0].name}<br>number of guests:${arr[0].number}`;
As a bonus problem, you're always displaying the details of the
first guest added to the array. Any subsequent guests will never be displayed.