I'm using ES6 in the following code in the angular app. Object.assign works as expected anywhere but IE.
const resetSuppItem = (item) => {
Object.assign(vm.suppitem, _.pick($scope.item, ['item1', 'item2', 'item3']));
}
What could be the workaround so it works in IE?
One workaround is to use jQuery method extend(), which is pretty simple and works in both IE and Chrome:
var user = {Name: 'Marshall', Surname: 'Depp'};
var newUserObj = $.extend({}, user);
newUserObj.Country = 'USA';
newUserObj.Mobile= 'xxxxxxxxxx';
console.log(user);
console.log(newUserObj);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With