JavaScript was originally created as a client-side web programming language, running in a web browser, to supercharge HTML. It has grown beyond the client-side programming.
With the introduction of Node.js (an open-source, cross-platform JavaScript run-time environment), you can run your JavaScript standalone or inside the server (instead of a browser). This allows you to use one single language for both the server-side and client-side programming.
JavaScript has to called inside script tags.
example:
<script>
alert("Hello Ajay!");
</script>