Dlaczego nie mogę wyświetlić tego tesktu w przeglądarce, a w turorialu online mu działa? Te dwa pliki są w jednym katalogu.
index.js
let example = 'Ahoj, \n' + 'przygodo!';
console.log(example);
document.getElementById('example').innerText = example;
index.html
<!DOCTYPE html>
<html lang="pl">
<head>
<script src="index.js"></script>
</head>
<body>
<p id="example"></p>
</body>
</html>