Created
January 12, 2023 17:21
-
-
Save nabily4e-dev/0e168d1a0519feb8ae254e7f61f4e5ef to your computer and use it in GitHub Desktop.
This file contains 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
const numbers = [1, 2, 3, 4, 5]; | |
const words = ['Call', 'me', 'to', 'the', 'moon']; | |
const doubledNumbers = numbers.map(function(number) { | |
return number * 2; | |
}); | |
console.log(doubledNumbers); | |
const newWords = ['hello', 'world', 'goodbye', 'moon']; | |
const uppercaseWords = newWords.map(function(word) { | |
return word.toUpperCase(); | |
}); | |
console.log(uppercaseWords); | |
const values = [1, 4, 9, 16, 25]; | |
const squaredValues = values.map(function(value) { | |
return value * value; | |
}); | |
console.log(squaredValues); | |
const halfValues = values.map(function(value) { | |
return value / 2; | |
}); | |
console.log(halfValues); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment