Skip to content

Commit e247ebe

Browse files
Merge pull request #2809 from chetannada/ltc-2469-js
Create 2469-convert-the-temperature.js
2 parents 118f54a + 2fb782f commit e247ebe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @param {number} celsius
3+
* @return {number[]}
4+
*/
5+
var convertTemperature = function(celsius) {
6+
let kelvin = celsius + 273.15; // initialize kelvin and add 273.15 to celsius
7+
let fahrenheit = (celsius * 1.80) + 32; // initialize fahrenheit and multiply 1.80 to celsius and add 32
8+
return [kelvin, fahrenheit]; // return kelvin and fahrenheit as an array
9+
};

0 commit comments

Comments
 (0)