Suppose there is a class AbstractCollection that may have many sub-classes, which have similar constructors (accepting entries). Is it possible to implement a clone() method in AbstractCollection, that would create and return a new instance of actual sub-class, passing in the entries?
class AbstractCollection<T> {
constructor(items: T[]) {
// ...
}
clone(): AbstractCollection<T> {
// TODO: implement
}
}