FAQ: Functions - Functions for Reusability

This community-built FAQ covers the “Functions for Reusability” exercise from the lesson “Functions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn How to Code

FAQs on the exercise Functions for Reusability

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Shouldn’t there be another ‘ADD BREAD’ in the function description

4 Likes

I’m just learning but I have the exact same question. There are 3 instructions in the function yet it performs 4?

1 Like

Nice - sharp eyed programmer-in-training you are. The instructions to the left in the black dialogue area have 2 ADD BREAD instructions but not on the visual set of instructions.

What does the “()” stand for in this function? It comes out of the blue. Does it have any meaning as code, or is it part of the name of the function?

function makeHamburger() {

I get that the { … } is there to englobe what the function will perform, but nothing about “()”

THERES 4 INSTRUCTIONS IN THE CODE, SO THE PROGRAM KNOWS TO ADD THE ADDITIONAL BUN WHEN YOU CLICK THE FUNCTION .,

NO NEED FOR IT TO DISPLAY ON THE ACTUAL PROGRAM TWICE, SINCE CLICKING THAT ONE BREAD BUTTON CAN PUT BREAD ON THE BOTTOM AND TOP OF THE BURGER.

FOR REPEATED INSTRUCTIONS IN A FUNCTION, ITS ONLY GOING TO DISPLAY THE BUTTON IN THE PROGRAM ONCE, SINCE ITS THE SAME INSTRUCTION JUST AT A DIFFERENT POINT OF THE FUNCTION