Skip to content

Instantly share code, notes, and snippets.

@brunohubner
Last active January 25, 2026 18:30
Show Gist options
  • Select an option

  • Save brunohubner/740f4dc6a9dd455b7b55ca3c1478e221 to your computer and use it in GitHub Desktop.

Select an option

Save brunohubner/740f4dc6a9dd455b7b55ca3c1478e221 to your computer and use it in GitHub Desktop.
function mostrarCupons(classes = 'item-code-link js-itemCode') {
const elList = document.getElementsByClassName(classes);
const arrayList = Array.from(elList ?? []).map((item) => item?.innerHTML);
const result = arrayList.reduce((acc, current) => acc += `${current}\n`, '');
console.log(result);
}
mostrarCupons();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment