Created
January 18, 2021 09:21
-
-
Save paulmwatson/e02fb3d0533f59fe9f3f7e1e6b766adb to your computer and use it in GitHub Desktop.
Comparing squaring.
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
//example1.js | |
const func1 = (foo, bar)=> { | |
const num1 = Math.pow(foo, 2) | |
const num2 = Math.pow(bar, 2) | |
} | |
//example2.js | |
const func1 = (foo, bar)=> { | |
const num1 = foo **2 | |
const num2 = bar **2 | |
} | |
//example1.js | |
const square = (data) => data * data | |
... | |
const func1 = (foo, bar)=> { | |
const num1 = square(foo) | |
const num2 = square(bar) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment