+ 2

Noop here How can i integrate a variable in a text ?

15th Sep 2018, 10:57 AM
mohamad ali
mohamad ali - avatar
4 Respostas
+ 1
mohamad ali, To call a variable back into a string you need to work with `` instead of "" or '' Here is an example: window.onload = function() { var text = ("SoloLearn!"); console.log(`String output: \n${text}`); } ${text} inside `` will return the variable inside the string. Therefore the output of this code is: //String output: //SoloLearn! Additional post: https://www.sololearn.com/discuss/1477768/?ref=app
16th Sep 2018, 1:30 AM
🌴Vincent Berger🌴
🌴Vincent Berger🌴 - avatar
+ 1
What programming language?
15th Sep 2018, 11:33 AM
Schindlabua
Schindlabua - avatar
+ 1
oh sorry js
15th Sep 2018, 12:16 PM
mohamad ali
mohamad ali - avatar
+ 1
Example: var hello = 5 document.write(hello) //its gonna output 5
16th Sep 2018, 12:15 AM
Joaquin Nievas
Joaquin Nievas - avatar