Stuck on Pizza.Js exercise


#1

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-javascript-functions/lessons/functions/exercises/parameters?action=lesson_resume&course_redirect=introduction-to-javascript

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
Oops! The test returned an error. Maybe you have a syntax error, or a typo. Hide error.
/home/ccuser/node_modules/babel-core/lib/transformation/file/index.js:590
throw err;
^

TypeError: /home/ccuser/workspace/javascript_101_Unit_3_v3/pizza.js: Duplicate declaration "takeOrder"
e[0m e[90m 4 | e[39m
e[90m 5 | e[39mtakeOrder()e[33m;e[39m
e[31me[1m>e[22me[39me[90m 6 | e[39me[36mconste[39m takeOrder e[33m=e[39m (topping) e[33m=>e[39m {consolee[33m.e[39mlog(e[32m’Order:pizza’e[39m)}
e[90m | e[39m e[31me[1m^e[22me[39me[0m
at File.buildCodeFrameError (/home/ccuser/node_modules/babel-core/lib/transformation/file/index.js:427:15)
at Scope.checkBlockScopedCollisions (/home/ccuser/node_modules/babel-traverse/lib/scope/index.js:398:27)

```

const takeOrder = () => {
console.log(‘Order: pizza’);
};

takeOrder();
const takeOrder = (topping) => {console.log(‘Order:pizza’)}

<do not remove the three backticks above>

#2

There is your duplicate. Remove one of them.


#3

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