Last active
November 29, 2016 12:01
-
-
Save TheoLeanse/ffd834d9505bc945e982f9dba8f06964 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
const values = [ 50, 500, 5000, 50000 ].sort((a, b) => a - b); | |
const min = values[0]; | |
const max = values[values.length - 1]; | |
const range = max - min; | |
const getScore = value => (value - min) / range; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment