Hi Fayez,
Your homework looks fine. As a minor point, the assignment didn't actually ask you to delete the meerkat from the array, just to find its index and log that index to the console. But you first delete the meerkat at the position found with indexOf and then use indexOf again to report the index. At that time meerkat is no longer in the array thereforr indexOf returns -1.
Hi Fayez,
Your homework looks fine. As a minor point, the assignment didn't actually ask you to delete the
meerkatfrom the array, just to find its index and log that index to the console. But you first delete themeerkatat the position found withindexOfand then useindexOfagain to report the index. At that timemeerkatis no longer in the array thereforrindexOfreturns -1.