Created
December 16, 2019 14:56
-
-
Save 01Clarian/eafa8f6ab441a43f45ac13e42986a038 to your computer and use it in GitHub Desktop.
Kelvin Conversion Function with Hardcoded Kelvin Argument
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
//grabbing the dom ids: | |
const convertKelvin = document.querySelector('#convertKelvin') | |
const results = document.querySelector('#results') | |
const kelvinNumber = document.getElementById('kelvinNumber') | |
convertKelvin.onclick = () => { | |
console.log('test') | |
convertKelvinReg(300) | |
} | |
// non curried function | |
const convertKelvinReg = (kelvin, formula) => { | |
formula = (Math.round((kelvin - 273.15) * 9 / 5) + 32) | |
return results.innerHTML = formula | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment