Rewrite example as JS