Skip to content

Instantly share code, notes, and snippets.

@zakki
Created October 10, 2014 05:43
Show Gist options
  • Save zakki/7920385a421f6af40638 to your computer and use it in GitHub Desktop.
Save zakki/7920385a421f6af40638 to your computer and use it in GitHub Desktop.
class A {
public a() {
alert("A!");
}
}
class B extends A {
public b() {
alert("B!");
}
}
var bs: B[] = [new B(), new B()];
var as: A[] = bs;
as[1] = new A();
as.forEach(a => a.a());
bs.forEach(b => b.b());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment