Syntax error in java script tutorial?


#1

what's wrong with this?

_**var takeOrder = true;**_
_**var topping = 'pepper';**_
_**var crustType = 'thick';**_

_**function takeOrder(topping, crustType) {**_
_**  if (Order) {**_
_**    console.log('Order: pizza topped with ' + topp);**_
_**    Order = false;**_
_**    } else {**_
_**      console.log('No Order including ' + topp);**_
_**      Order = true;**_
_**    }**_
_**  **_
_**}**_

_**takeOrder('pepper');**_

_**takeOrder('pepper');**_

#2

var takeOrder = true;
var topping = 'pepper';
var crustType = 'thick';

function takeOrder(topping, crustType) {
  if (Order) {
    console.log('Order: pizza topped with ' + topp);
    Order = false;
    } else {
      console.log('No Order including ' + topp);
      Order = true;
    }
  
}

takeOrder('pepper');

takeOrder('pepper');

sorry


#3

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