AI

Arrays are lists of items. You can access items using their index (starting from 0) and check the length.

Your Task:

  • Create firstItem = first item in the cart (index 0)
  • Create lastItem = last item (using length - 1)
  • Create totalItems = total number of items in the cart
TypeScript Solution
Loading...

Submit your code to see test results