EN
JavaScript - prepend text to beginning of string
0 points
In this article, we would like to show you how to prepend text to the beginning of a string in JavaScript.
Quick solution:
xxxxxxxxxx
1
var text = 'world';
2
3
text = 'Hello ' + text;
4
5
console.log(text); // 'Hello world'