Hello I think its a basic question or mistake i believe i want to ask here (my appologies for being ignorant on subject matter) but I want to run this code from on of the java's reference book (JavaScript: The Definitive Guide Book by David Flanagan) in a script tag in an html file. I sure it's probably a very little mistake, below is my code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>js book example1</title>
</head>
<body>
<p>test</p>
<script>
document.write("<h2>Table of Fibonacci Numbers</h2>");
for (i = 0, j = 1, k = 0. fib = 0; i < 50; i++, fib = j + k, j = k, k = fib) {
document.write("Fibonacci(" + i + ") =" + fib);
document.write("<br>";)
}
</script>
</body>
</html>


document.write- it's a slow and outmoded way of adding content to a webpage (and it won't work as you would expect in callback functions or event-handlers), use the DOM API instead (document.createElement, etc).