Factory Functions

in Factory Functions, why did we have to add a const tinCan to access the function, why can’t we just access it through factoryFunctions.beep() instead of adding a constant and then calling the property

https://www.codecademy.com/courses/introduction-to-javascript/lessons/advanced-objects/exercises/factory-functions

thanks in advance :slight_smile:

You can do it, but I guess if you have more than one method in your object, it’s the best way to create a variable. So you need to write less code.

If there are other reasons for this, I am also interested to know them. :roll_eyes: