+ 1
Code not working
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <script> let username="satveek"; let items =5; let text= 'hello ${username } you have ${items} items in your cart' console.log(text); </script> </body> </html>
2 Answers
+ 6
Where you declared text you need to use back ticks like this `` for it to run
+ 1
Bro you should write script tag with indentation and main problem is that you should write
let text;
text= `hello ${surname} you have ${items} in your cart`;