Answer the question
In order to leave comments, you need to log in
Creating objects in js using prototype?
Good afternoon.
I often come across this way of creating objects in JS:
function Obj = {
this.someVar = 1;
this.someVar2 = 2;
}
Obj.prototype = {
fun1: function() {},
fun2: function() {}
}
function Obj = {
this.fun = function () {};
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question