Prototype - Sam647254/Programetoj GitHub Wiki

Java

public class Prototype implements Cloneable {
  public Prototype clone() throws CloneNotSupportedException {
    return (Prototype) super.clone();
  }
}

// main
class Example {
  public static void main(String[] arguments) {
    var original = new Prototype();
    var clone = original.clone();
  }
}

TypeScript

// main
const original = {};
const clone = {...original};