I use the underscore library to copy objects, the _.clone() method. And this method works differently on different versions of angular, or maybe the problem is something else?
F.e:
class FooBar {
foo: string;
bar: number;
constructor(foo: string, bar: number) {
this.foo = foo;
this.bar = bar;
}
toString() {
return this.foo;
}
}
...
const foo = new FooBar("fooBar", null);
const bar = _.clone(foo);
console.log(bar); // Angular v12 output: {foo: "fooBar", bar: ƒ}, Angular v13 output: {foo: "fooBar"}
Why wasn't the method copied?