index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My JavaScript</title>
</head>
<body>
<script src="main.js"></script>
</body>
</html>
main.js
'use strict';
//console.log(50 + '20');
const color = prompt('Color?');
switch (color) {
case 'red':
console.log('Stop!');
break;
case 'yellow':
console.log('slow down');
break;
case 'blue':
case 'green':
console.log('Go!');
break;
default:
console.log('Wrong color');
break;
}