I,m started reading book of Kirupa, Javascript from zero.
there is an example, on page 70, about “for” cycles.
I must write the code, then see the result.
But nothing happened! i’m checked all past of code, there is all right!
please help! what should i do?
1 Like
Can you share the code you have written? Also, do you see any errors on the Console?
1 Like
the fact is that I don’t really understand this, I don’t know where this console is.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Loops!</title>
<style>
</style>
</head>
<body>
<script>
for (let i = 0; i < 10; i++) {
saySomething();
}
function saySomething() {
document.writeIn("hello!");
}
</script>
</body>
</html>
I think I see your problem. In the saySomething
function, change document.writeIn
to document.writeln
. It’s a lowercase “L”, not a capital “I”.
1 Like