Created
March 6, 2022 23:22
-
-
Save natafaye/c74958a1b15d79b78b91f75bf38e4309 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
// https://www.codewars.com/kata/563b1f55a5f2079dc100008a | |
function getLargerNumbers(a, b) { | |
return a.map( (aItem, index) => Math.max(aItem, b[index]) ); | |
// const newArray = a.map( (aItem, index) => { | |
// const bigger = Math.max(aItem, b[index]) | |
// return bigger; | |
// }) | |
// return newArray; | |
// return a.map( function(aItem, index) { | |
// const bigger = Math.max(aItem, b[index]) | |
// return bigger; | |
// }) | |
// const returnBigger = (aItem, index) => { | |
// const bigger = Math.max(aItem, b[index]) | |
// return bigger; | |
// } | |
// return a.map(returnBigger) | |
} | |
// function getLargerNumbers(a, b) { | |
// const newArray = []; | |
// // Loop over the arrays | |
// for(let i = 0; i < a.length; i++) { | |
// // Get the bigger | |
// const bigger = Math.max(a[i], b[i]) | |
// newArray.push(bigger); | |
// } | |
// return newArray; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment