Skip to content

My code #176

Description

@jaimeoakes
Image

Activity

  1. SantiagoSuarezRoig commented on Nov 25, 2025

    @SantiagoSuarezRoig

    Hi bro, everything good with this? you could solve it?

  2. jaimeoakes commented on Nov 25, 2025

    @jaimeoakes
    Author

    Hey, what's up! Yeah, the code is solved and functional. It takes the cart object as a parameter and then loops through the array to sum the quantities. checkoutCartQuantity works as the counter, and I placed it inside the function scope so it resets every time the function runs. totalItems stores the final result. I pass the function with its parameter because a function is still a value in JavaScript. Finally, I insert the result into the template string using interpolation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions