[SOLVED] How to put a variable inside a string? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

[SOLVED] How to put a variable inside a string?

How to put a variable inside a string? Code: https://code.sololearn.com/WkXHDc2ZgkZ2/?ref=app I took a look on how to implement ES6 in SL but didnt get my code working.. Tried on android 8.1 & 5.1.. with no succes.. Any help is appericiated! P.S. I do not mean "string"+variable;

30th Aug 2018, 8:51 AM
šŸŒ“Vincent BergeršŸŒ“
šŸŒ“Vincent BergeršŸŒ“ - avatar
9 Respostas
+ 6
document.write (`Firstname ${one[0]} Lastname ${one[1]} Firstname ${one[0]} Lastname ${one[1]} Firstname ${one[0]} Lastname ${one[1]}`); https://code.sololearn.com/WBs6H4TvV2zu/?ref=app
30th Aug 2018, 9:07 AM
CalviÕ²
CalviÕ² - avatar
+ 4
If this helpsā˜ŗļøā˜ŗļø https://code.sololearn.com/Wa0v9RXpChck/?ref=app
30th Aug 2018, 9:05 AM
Meet Mehta
Meet Mehta - avatar
+ 3
Try to upgrade webview from Play Store, would work. :)
30th Aug 2018, 9:54 AM
CalviÕ²
CalviÕ² - avatar
+ 2
I do get error when I tried both solutions. Unexpected token ILLEGAL android 5.1
30th Aug 2018, 9:13 AM
šŸŒ“Vincent BergeršŸŒ“
šŸŒ“Vincent BergeršŸŒ“ - avatar
+ 2
Worked on android 8.1! Thanks for the solution!šŸ‘
30th Aug 2018, 9:22 AM
šŸŒ“Vincent BergeršŸŒ“
šŸŒ“Vincent BergeršŸŒ“ - avatar
0
Here you are :) document.write ("Firstname " + one[0] + " Lastname " + one[1] + " Firstname " + one[0] + " Lastname " + one[1] + " Firstname " + one[0] + " Lastname " + one[1]);
30th Aug 2018, 8:57 AM
Sam Pache
Sam Pache - avatar
0
(To copy/paste instead of the line you've written :p)
30th Aug 2018, 8:57 AM
Sam Pache
Sam Pache - avatar
0
Sam Pache please re-read.. I do not mean "string"+variable;
30th Aug 2018, 8:59 AM
šŸŒ“Vincent BergeršŸŒ“
šŸŒ“Vincent BergeršŸŒ“ - avatar
0
Have a look at the string concatenation then :) str1.concat(str2);
30th Aug 2018, 9:05 AM
Sam Pache
Sam Pache - avatar