Hello. How to set something like a constructor inside a function, which will be invariably called when creating an object (there must be a certain sequence of actions and initialization of one variable in the constructor):
var clazz = new myFunction(op); It is desirable that it be inside the function:
function myFunction(op) { constructor(){ ... ... ... ... } } Ps. Without the use of libraries.