๐ Bug HuntJS JavaScript Easy+10 XP
Off-by-One Error
This function should return the last element of an array, but it has a bug.
๐ Find the bug
1
function lastElement(arr) {2
return arr[arr.length];3
}๐ The bug is on line 2