re: Review of my first JavaScript code? VIEW POST


There is no need to init the text variable on top of the function. Just init it before setting innerHTML

const text = `Hello ${rebelName}, you have a total of ${xWings} xWing fighter pilots. Good luck!`;
document.getElementById("demo").innerHTML = text;

Thank you for your feedback! Taken into account.

code of conduct - report abuse