In some languages, frequently used strings are defined as variables/constants, which are called instead of literal strings. Is this the same with JavaScript? In particular, I have frequent use of the string 'none'
. Instead of writing the literal 'none'
everywhere in the code, would it improve performance if I define:
var none = 'none';
and use none
everywhere in the code? Or, is there a way to intern a literal string expression so that it is evaluated only once?