← Back to challenges

Temperature Converter

JavaScriptHardalgorithmsnumbersmathcontrol_flow

Instructions

Create a function that converts Celsius to Fahrenheit and vice versa.

Examples

convert("35°C") ➞ "95°F"

convert("19°F") ➞ "-7°C"

convert("33") ➞ "Error"

Notes

  • Round to the nearest integer.
  • If the input is incorrect, return "Error".
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.