title: Writing a javascript function which accepts a single array argument
body: <p>Please write a function called lastElement which accepts a single array argument. The function should return the last element of the array (without removing the element). If the array is empty, the function should return null.</p>
  <ol>
  <li>lastElement([3,5,7]) //7</li>
  <li>lastElement([1]) //1</li>
  <li>lastElement([]) //null</li>
  </ol>
  <pre><code>** the code that I wrote **
  
  let array = [3, 5, 7];
  
  function lastElement (array) { 
      return array[array.length - 1];
  }
  
  </code></pre>
  <p>I'm flummoxed on the last part with the function returning null if the array if empty.</p>