I'm using object.create to create an object, based on a prototype I created.
This is the prototype
var employeePrototype = {
calulateTax: function() {
console.log(salary * taxRate);
}
};
This is the object I created.
var jack = Object.create(employeePrototype);
jack.salary = 25000;
jack.taxRate = .40;
jack.calulateTax();
When I call jack.calculateTax, I get the following error
index.html:14 Uncaught ReferenceError: salary is not defined at Object.calulateTax