Обява JavaScript у HTML

В строке

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello JavaScript</title>
</head>
<body>
<h1>Hello! </h1>
<button onclick="alert('you are click me')">Click !</button>
</body>
</html>

В теле

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello JavaScript</title>
</head>
<body>
</body>
</html>
<script>
var name = 'Jack'
console.log(name)
</script>

В отдельнм файле

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello JavaScript</title>
</head>
<body>
</body>
</html>
<script src="app.js">
</script>