Temperature Converter

Published by Werdna in

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.0

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

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

Notes

  • Round to one decimal place.
  • For this challenge: 1 Celsius = 273.14 Kelvin.
Watch a quick demo on how Edabit works.