Introduction to Functions


Hi, I don’t understand the syntax in bold. Can someone explain the meaning?
I understand the const and pressPowerButton, but what is the meaning of = () => ?

const pressPowerButton = () => {
if (calculatorIsOn) {
console.log(‘Calculator turning off.’);
calculatorIsOn = false;

Thanks in advance.


its the arrow function:

this might be slightly easier to read:


I see, just like lambda.
The mozilla link is kinda confusing, but the second one explains very well.

Thanks again. :slight_smile:


Actually, the mozzila one is really good and thorough but more difficult to read.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.