Skip to content

Instantly share code, notes, and snippets.

@matiasfha
Last active October 19, 2022 14:19
Show Gist options
  • Save matiasfha/64b105fb5cceebb56235bc25327ad259 to your computer and use it in GitHub Desktop.
Save matiasfha/64b105fb5cceebb56235bc25327ad259 to your computer and use it in GitHub Desktop.
Exmaple
/*
* shameless plug: https://www.escuelafrontend.com/articulos/metodos-de-arreglos
*/
const arr = [1,2,3,]
const failureMessages = []
arr.forEach((item) => {
failureMessages.push("<li>${item}</li>")
})
// Otra forma
arr.forEach(function Geneador(item) {
failureMessages.push("<li>${item}</li>")
})
// Otra forma
function Generador(item) {
failureMessages.push("<li>${item}</li>")
}
arr.forEach(Generador)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment