JavaScript Object Test

by mrrodd

JavaScript

var viewModel = {
    firstName: "Bob",
    lastName: "Smith"
};
console.log(viewModel);

 var model = function(){
    this.firstName = "Bob";
    this.lastName = "Smith";
    this.getModel = function() {
         return this;
    };
};
var vm = new model();
console.log( vm );