Return to site

🌍 💚 GREEN IT Developer: Make the most of string concatenation

· greenIT

JavaScript generates temporary ⌚ variables in the background when performing variable concatenation. Due to this, some syntax is more efficient 💪 than others and uses less RAM.

Instead of:

a += 'x' + 'y';

write:

a += 'x';

a += 'y';

#greenit #developer #concatenation