174
rated 0 times
[
175]
[
1]
/ answers: 1 / hits: 53402
/ 8 Years ago, mon, february 29, 2016, 12:00:00
In JavaScript, if I want to loop through a dictionary and set properties of another dictionary, I'd use something like this:
for (let key in dict) {
if (obj.hasOwnProperty(key)) {
obj[key] = dict[key];
}
}
If obj
is a TypeScript object (instance of a class), is there a way to perform the same operation?
More From » object