I'm working with the following:
define(["knockout"], function(ko) {
var vm = this;
(function() { // I'm tempted to delete this
// init
vm.data = ko.observable("");
// other stuff
})(); // and this
return vm;
});
The person who wrote this said they thought it was a best practice but didn't know why. I understand this is a closure but we don't need any of the "private" functionality that closures provide in this instance, so this just seems like noise to me, but I'm probably overlooking something. What's the point?