[js] conditions with variables appearing on the same page