Introduction
In this lab, we will explore a JavaScript function that helps us find the last element of an array. We will learn how to check if an array is valid and has a length property, and how to use the length property to compute the index of the last element. We will also learn how to return undefined
if the array is empty or invalid.