i just wonder is there any difference between self and this keyword usage or both same
see this example which use this keyword
var ViewModel = function(first, last) {
this.first = ko.observable(first);
this.last = ko.observable(last);
this.full = ko.computed(function() {
return this.first() + " " + this.last();
}, this);
};
see this example which use self keyword instead of this keyword
var ViewModel = function(first, last) {
var self=this;
self.first = ko.observable(first);
self.last = ko.observable(last);
self.full = ko.computed(function() {
return self.first() + " " + self.last();
}, self);
};
which approach is good and why accepted ? thanks