Difference between knockout View Models declared as object literals vs functions

There are a couple of advantages to using a function to define your view model. The main advantage is that you have immediate access to a value of this that equals the instance being created. This means that you can do: var ViewModel = function(first, last) { this.first = ko.observable(first); this.last = ko.observable(last); this.full = … Read more