projects/25-Calculator/script.js
/*
  This function exists to make sure that after an
  operator button is clicked the operation happens, without this 
  function the calculator does not change the operation after a 
  button click;
*/
This function exists to make sure that after an
operator button is clicked the operation happens, without this
function the calculator does not change the operation after a
button click.
This function exists to make sure that after an operator button is clicked the operation happens without this function the calculator does not change the operation after a button click .
function operator(operator = "") {
  if (type == "none") {
    type = operator;
    transfer(type);
  } else {
    solution();
    type = operator;
    clearDisplay(0, true, secondaryView.textContent.slice(0, -1) + type);
  }
}
function operator ( operator = "" ) { if ( type == "none" ) { type = operator ; transfer ( type ) ; } else { solution ( ) ; type = operator ; clearDisplay ( 0 , true , secondaryView . textContent . slice ( 0 , - 1 ) + type ) ; } }
This function exists to make sure that after an
operator button is clicked the operation happens, without this
function the calculator does not change the operation after a
button click;
This function exists to make sure that after an operator button is clicked the operation happens without this function the calculator does not change the operation after a button click ;