dynamically display data only displaying last element javascript code example Example: last element from list javascript const lastItem = colors[colors.length - 1]