Skip to content

Instantly share code, notes, and snippets.

@suissa
Created February 22, 2020 03:57
Show Gist options
  • Save suissa/fcca91b2a7322153fcce37700422c74f to your computer and use it in GitHub Desktop.
Save suissa/fcca91b2a7322153fcce37700422c74f to your computer and use it in GitHub Desktop.
Demonstração de como criar operações básicas de matemática usando Arrays - divisão - refatorando
const tamanhoDa = (lista) => lista.length
const dividir = (x, y, total = 0) =>
tamanhoDa(
crieUmaListaDeTamanho(x).ePreenchaCom(y)
.filter(n => {
total = total + n
return total <= x
})
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment