Created
May 11, 2019 03:50
-
-
Save suarezafelipe/e1d719c2a49ce5c07bbefd61e3f002d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// B: arreglo de beneficios | |
// C: arreglo de costos | |
const program = (B, C) => { | |
let costoBeneficio = C | |
.map(el, i) => { | |
razon: el / B[i], | |
indice: i | |
} | |
.sort(a, b) => {a.razon - b.razon}[0]; | |
console.log(JSON.stringify(costoBeneficio)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment