chore(js): Declare vars only once since they're hoisted