Array Basics

πŸ‘¨β€πŸ’Ό Perfect! You've mastered basic array operations.
πŸ¦‰ A common pattern for getting the last element:
const last = products[products.length - 1]

// Or using at() (newer, cleaner):
const last = products.at(-1) // Negative index counts from end
The at() method is great for accessing from the end without the length - 1 math.

Please set the playground first

Loading "Array Basics"
Loading "Array Basics"
Login to get access to the exclusive discord channel.