I'm getting `undefined` for my last print, is that suppose to happen?


#1

Question

I’m getting undefined for my last print, is that suppose to happen?

Answer

Yes, that’s exactly what’s supposed to happen! The array only has a length of 3, so at index 3 we’re trying to get the fourth item in the array, but there is no fourth item.