replicate example from dartjs site