+ 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 ответов
+ 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
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