Hi I have a web program that I need to run in IE8. On IE8 the javascript reduce method is not supported directly so I transferred in the Polyfill for the reduce method as mentioned here: IE/JS: reduce on an object
Now I've ran into another issue with Object.defineProperty() where the object doesn't support this action. I've been looking at this solution Object.defineProperty alternative for IE8 but I can't figure out how to transfer it over to the Polyfill as an alternative to Object.defineProperty().
Looking for methods on how to fix up the Polyfill to get reduce working and solve the Object.defineProperty() issue or any other method to get reduce running on IE8.
reduce()isn't supported in old browsers, you can use the polyfill like below. With this polyfill,reduce()can work well in IE 8:Sample code: