Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
Cómo depurar una función que está bajo una cadena de plantilla

En el siguiente código, trabajé con un enlace API que muestra productos falsos como un sitio web de comercio electrónico. Cuando intento depurar la función addToCart que se llama bajo una cadena de plantilla. No se rompe en ese punto. Ayúdame con cómo depurarlo.

Enlace del sitio web: https://inspiring-payne-594c82.netlify.app/

Agregué el código específico donde está mi problema.

 // show all product in UI const showProducts = (products) => { products.forEach(product => { const image = product.image; const div = document.createElement("div"); div.classList.add("product"); div.innerHTML = `<div class="single-product"> <div> <img class="product-image" src=${image}></img> </div> <h3>${product.title}</h3> <p>Category: ${product.category}</p> <h2>Price: $ ${product.price}</h2> <button onclick="addToCart(${product.id}, ${product.price})" id="addToCart-btn" class="buy-now btn btn-success">add to cart</button> <button id="details-btn" class="btn btn-danger">Details</button></div> `; document.getElementById("all-products").appendChild(div); }) };
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!