Skip to content

Instantly share code, notes, and snippets.

@emberian
Forked from anonymous/BXscGvpi
Created March 25, 2012 20:25
Show Gist options
  • Save emberian/2199552 to your computer and use it in GitHub Desktop.
Save emberian/2199552 to your computer and use it in GitHub Desktop.
a guest on Mar 25th, 2012 - -.- ?
function lastElement(array) {
if (array.length > 0)
return array[array.length - 1];
else
return null;
}
show(lastElement([1, 2, null]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment