The below code works fine in browser but when I try to run via node (in command prompt), it give error : Uncaught SyntaxError: Unexpected identifier
Please find the screenshot attached for an error.
//index.js
// This is my first JS code
console.log('Hello World');
//index.html
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
</head>
<body>
<h1>Hello World</h1>
<script src="index.js"></script>
</body>
</html>

dircommand in cmd