chore(js): Declare vars only once since they're hoisted
Merge pull request #7525 from ewinslow/js-upgrades

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