8th Jan 2020, 8:44 AM
Abdurahim Maulana
Abdurahim Maulana - avatar
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 đŸ™đŸŸ
8th Jan 2020, 9:21 AM
Alfred Juma
Alfred Juma - avatar
+ 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);
8th Jan 2020, 9:19 AM
Anton Böhler
Anton Böhler - avatar