+ 1
Run a function on objet creation
I would like to run a function when I create an object. To do so, I created a function that creates an object and then runs the code that follows, which inserts a div in the html code. However, is this the good way to do this? Is there any mean to insert a method in the constructor that will automatically be run when the object is created? Thanks for any answer! https://code.sololearn.com/WDl8C2iFwxZT/?ref=app
1 Answer
+ 2
I think your code is correct. đ