Can someone help me understand functions? I am so confused


Function Review

no error

var calculatorOn = false;

function pressPowerButton() {
  if (calculatorOn) {
    console.log('Calculator turning off.');
    calculatorOn = false;
  } else {
    console.log('Calculator turning on.');
    calculatorOn = true;

// Output: Calculator turning on.

// Output: Calculator turning off.


Do you have a specific example? What is it that you don't understand?


I want to understand how different parts of how a function works. For example, parameters, arguments. Sort of breaking it down piece by piece. I can provide an example if you want?


leveraging some old posts of CC.
check this out..

and also check this...


Thanks that helps. I will you know if I have any further questions


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