Is there still a purpose to factory functions or should we always use classes?

I just finished the Javascript class lessons. https://www.codecademy.com/courses/introduction-to-javascript/lessons/classes/exercises/review-classes?action=resume_content_item

There are top questions at the bottom of the page. They are


  1. Assigning a value to a property without a setter

  2. Is there still a purpose to factory functions or should we always use classes?

Those links are dead but I would really love to read what they were talking about. Especially number 2 (which is also the title of this post)

Thank you for any contributions

As for the first question, the link provided in the exercise is working fine for me.

https://discuss.codecademy.com/t/assigning-a-value-to-a-property-without-a-setter/438243

And here is an article I found with a better explanation for the second question.

https://medium.com/javascript-scene/javascript-factory-functions-vs-constructor-functions-vs-classes-2f22ceddf33e

Hope this helps.