← Back to challenges

Temperature Converter

JavaScriptHardnumbersconditions

Instructions

Create a function that takes an array with temperature type, temperature, and a second temperature type. The temperature types can be Celsius, Fahrenheit, or Kelvin. Return the temperature type (in the array) converted into the second temperature type.

Examples

converter(["fahrenheit", 3] , "kelvin") ➞ 257

converter(["celsius", 10] , "fahrenheit") ➞ 50

converter(["celsius", 20] , "kelvin") ➞ 293.1

Notes

Round to one decimal place.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.