How are the functions connected and where does "`number`" come from?

or where the body of your function is getting so large, you need to split it into different smaller functions. Having separate functions makes its easier to test the different functions/components.

In this lesson, the helper function doesn’t add much value, but explains the concept nicely

1 Like

That would be F degrees, with C degrees being 15.

The idea I get from helper functions is that we can abstract the maths away from the general function.

const cToF = c => 9 * c / 5 + 32

const fToC = f => 5 * (f - 32) / 9
function fahrenheitToCelsius (fahrenheit) {
  return fToC(fahrenheit)
}
function celsiusTofahrenheit (celsius) {
  return cToF(celsius)
}

Not the best examples, but one can get the idea.

1 Like

I see! There is defiantly an underlining, but not quite outright said/shown, lesson of code stability and how you build the code up for reliability and readability. For @stetim94 , I understand now that debugging a huge Function code block could be a nightmare when combing too many…I wanna use the term expressions or operations. Combo that with what @mtf pointed out and it sounds like way better practice to

“(keep)…abstract…maths away from the general function.”

Thus creating a more coherent function for people trying to read it and figure out what it’s doing. As well as (apologies if I’m repeating) probably making it easier to find errors.

If my interpritation is off let me know but this seems to have explained things very nicely. As always, thank you! At the risk of sounding cheesy; You all make this community wonderful!