sample to js