generate JS that uses 'var' for variables