Just create another instance of the class and copy over the properties:
clone() {
return Object.assign(Object.create(Object.getPrototypeOf(this)), this);
// or simply
// return Object.assign(new this.constructor({}), this);
}
You might also pass the options so that the properties are initialised in the constructor as expected:
clone() {
return new Foo({
firstName: this.name.split(" ")[0],
lastName: this.name.split(" ").slice(1).join(" "),
objectId: this.id
});
}
However, notice that creating multiple instances with the same (but supposedly unique) id might not be the best idea.