Escape js array labels.

Closes #6222