Backtick In JavaScript(Nodejs Route Example)

Backtick are also know as template literals, template strings, fancy strings. it was introduced in the es2015 specifications.it is denoted by ``.

Example :

Let Assume we need to combine constant and string in our Nodejs application.

our snippet is basic route in Nodejs application where api variable having value of any URL link for example

let api = “api/v1”;

Now what we are trying to do is we are trying to combine constant and string without using “+” operator. both code work but in JavaScript we have better way of doing this and that is by using Backtick.

Without using Backtick:

Without Using Backtick

Using Backtick:

Using Backtick

Note : this is basic usage of using backtick in Nodejs but it can be used in any JavaScript .

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Azen Moktan

A highly resourceful, innovative, and competent Software Engineer with extensive experience in the design , coding and problem solving .