Skip to content

Instantly share code, notes, and snippets.

@01Clarian
Created Dec 16, 2019
Embed
What would you like to do?
Kelvin Conversion Function with Hardcoded Kelvin Argument
//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