When dealing with Object.create()
I came across this question and in summary it mentions:
- polyfill that was used to retrofit IE8 with
Object.create
functionality, however this polyfill doesn't support a second parameter - shim which requires inclusion of es5-shim
with various trains of thought on how to best accomplish this.
Here's my relevant code I am using:
//json_string variable is passed via php
var arrayOfOptions = jQuery.parseJSON(json_string);
var template = {
// my instance that I want to initialize based on the properties provided
};
var instance = Object.create(template, {'options':{value:arrayOfOptions, enumerable: true}});
My question is how did programmers accomplish this task prior to ES5, and more specifically what would be a better/alternative implementations of initializing an object based on on a set of passed properties without utilizing the second parameter?