0
how to fix this
help me to fix this https://code.sololearn.com/WOV6k1aA14Zd/?ref=app
2 Answers
+ 3
The function inside the document.write() was not well called.
Use the addion symbol to call the function value as part of your string. Eg
document.write("some text"+function()+"other text")
Same to the defined variables, you need to use the adittion symbol(+) and remive the comas placed after strings.
Happy codingđ Keep coding đđŸ
+ 2
don't know if you want to do this but here you go (put this into your js-tab and remove the unnecessary stuff in the html-tab):
var a = 12;
var b = 4;
function PerkalianDengan2(b) {
return 2*b;
}
document.write("Dua kali dari" + b + "adalah" + PerkalianDengan2(b) + "<br>");
document.write("Nilai dari a adalah " + a);