convert example to js