ensemble coding using javascript