How to create a prototype for this type of constructor?

I explore the deep end of JavaScript. Well, let’s say I have a constructor function like this. Yes, I know this is a weird way of creating a constructor function, but … function Animal(name){ …

How to block parameters of function which is in prototype overrided after created another object

To avoid copies of the same function I hear that functions must define in prototype. And I hear that OOP inheritance is suck that is why I tried to use factory function when go deep in Javascript. But …

Call a function “dynamically” in JS with something like

I’m trying to learn how to dynamically create objects and apply functions to them with JS and HTML. How can I use a <select> dropdown’s text/value to call a function on an object as directly as possible? In the past I’ve used functions in an array, if then statement, or conditional chain but this seems like extra work. I’m open to suggestions on dynamic object instance creation as well because I’m not sure my method in this example is best practice. Here is my example: HTML JS Description: I can create a new object instance of myClass dynamically by typing