Set the src attribute of the opening script tag to "script.js".

<html>
<head>
</head>
<body>
  <h1>Twitter</h1>
  <p>Sign up or log in</p>
  <script>console.log("It works!");</script>
</body>
</html>]]>

Make sure to assemble scr="script.js".