| Node.js URL.hash API
Node.js URL.hash API
When we say about the url.hash, it is an inbuilt application programming interface of class URL in url module. And it is used to get and set the fragment portion of the URL.
And syntax of Node.js URL.hash is given below
url.hash
And when we say about the return value of above syntax is to gets and sets the fragment portion of the URL.
And to understand this we will take a example of url.hash method. And name the file as ExampleURLHash.js and now to run the file we open node.js command prompt.
To get the code click hereDownload Code
And to run the above file we use the Node.js command prompt and run the below command.
Node ExampleURLHash.js
And output of above command is given below:-
And we will take one more example to get the part of URL in Node.js. Below is the file name is ExampleURLHash2.js.
To get the code click hereDownload Code
And to run the above file we use the Node.js command prompt and run the below command.
Node ExampleURLHash2.js
And output of above command is given below:-
| | |