Created
December 14, 2019 15:31
-
-
Save ppaska/598d1d71d29398032531f7ca768c7493 to your computer and use it in GitHub Desktop.
JS Python sample gist
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
arr = [4, 9, 16] | |
def sqrt(a): | |
return Math.sqrt(a) | |
# use Array.map() with Python function | |
roots = arr.map(sqrt).join(",") | |
# use Array.map() or use arrow function | |
roots = arr.map(i => Math.sqrt(i)).join(",") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment