0

JS problem

Hello, how can I change both "text" variables so that the result shows "hello" instead of "hi"? Thanks. https://code.sololearn.com/W02PpUXJU63P/?ref=app

19th Oct 2023, 1:42 PM
JonySVK
JonySVK - avatar
4 odpowiedzi
+ 4
**🇦🇪|🇦🇪** ,JonySVK , You can change the string by using u the `replace()` method.. According to your code... the `replace()` method replaces the first occurrence of 'hi(replace valve)' with 'hello(your string)' See this modified version of your code. https://code.sololearn.com/WXyLHQ45m2hP/?ref=app
19th Oct 2023, 3:32 PM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
0
I didn't get your point, var text = 'hello' var text1='hello' console.log(text,text1)
19th Oct 2023, 2:13 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
0
I am asking that if I put var = text 'hello hello hi hello' how can I achieve that when I put console.log(text), then it writes "hello hello hello hello" to the console?
19th Oct 2023, 2:23 PM
JonySVK
JonySVK - avatar
0
Darpan kesharwani🇮🇳 Thank tou very much.
19th Oct 2023, 4:12 PM
JonySVK
JonySVK - avatar