Created
October 24, 2021 15:36
-
-
Save codergautam/b907e3250d9e24a6a73a529324bf62ea to your computer and use it in GitHub Desktop.
Easily convert between to types of numbers!
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
/* | |
num = val | |
newNum = ? | |
convert(2, 10, 4) //20 | |
convert(5, 10, 50) //100 | |
*/ | |
const convert = (num, val, newNum) => (newNum * val) / num |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment