FrontendDeveloper.in

ECMAScript question detail

Hashbang syntax

Hashbang(as known as shebang) grammar has been supported with a sequence of characters(#!) at the beginning of an executable script to define the interpreter for the program to run. In other words, this syntax is helpful to tell the operating system which interpreter to use while executing the script.

For example, the below javascript file will be executed in NodeJS interpreter from Unix commandline.

#!/usr/bin/env node
'use strict';
console.log("Hello world from hashbang syntax");
Back to all ECMAScript questions
Get LinkedIn Premium at Rs 399