get the constructor of a class's instance.

class K { constructor(value) { this.value = value } }
const a = new K(1)
const b = new (constructorOf(a))(2) // equivalent to `const b = new K(2)`