I am newbie of JavaScript and studying with textbook. I wrote below code, and alert modal window was displayed correctly, but document.writeln(triangle(8,5)) does nothing. Why?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Area of Triangle</title>
</head>
<body>
<h1>Area of Triangle</h1>
<pre>
<script type="text/javascript" charset="utf-8">
<!--
var triangle;
triangle = function(base, height) {
return base * height / 2;
};
alert(triangle(8, 5));
documnt.writeln(triangle(8, 5));
-->
</script>
</pre>
</body>
</html>
Thank you for your kindness.
You’ve misspelled
documentasdocumnt. Try: