get last object with specific property from array javascript code example Example: javascript get last element in an array var last = arr[arr.length - 1]