Conversation
📝 HackYourFuture auto gradeAssignment Score: 0 / 100 ✅Status: ✅ Passed Test Details |
rafaelhdr
left a comment
There was a problem hiding this comment.
Task 1 and 2 were excellent. The task 3 and 4 could be improved.
| @@ -0,0 +1,19 @@ | |||
| const convertor = { | |||
There was a problem hiding this comment.
This code is good, and it is doing what is being asked. But it is not exported properly, and this is a library.
If you try to run the example, it fails (SyntaxError: Named export 'convertDaysToHours' not found.)
Try to fix it to make this a library.
| console.log("Wind chill in " + cityName3 + ": " + windChill3.toFixed(2) + "°C"); No newline at end of file | ||
| const celsiusToFahrenheit = (celsius) => (celsius * 9) / 5 + 32; | ||
| const celsiusToKelvin = (celsius) => celsius + 273.15; | ||
| const getTemperatureStatus = (celsius) => |
There was a problem hiding this comment.
This is a trap. Having so many ternaries chaining each other is really hard to read/maintain.
Ternary is really nice if you are doing just a single check (const a = b ? c : d). But if you have so many, try to use if else.
| console.log(`Temperature: ${celsiusToFahrenheit(tempCelsius).toFixed(2)}°F`); | ||
| console.log(`Temperature: ${celsiusToKelvin(tempCelsius).toFixed(2)}K`); | ||
| console.log(`Status: ${getTemperatureStatus(tempCelsius)}`); | ||
| console.log("---"); |
There was a problem hiding this comment.
This --- is too early. It ends separating wrong. Check this output
Weather Report for Amsterdam
Temperature: 22°C
Temperature: 71.60°F
Temperature: 295.15K
Status: Warm
---
Wind chill in Amsterdam: 22.71°C
No description provided.