DEV Community

Ajay Baraiya
Ajay Baraiya

Posted on • Edited on

Very usefull Backtick(`) or Template literal #React Qucik Notes.

*Template Literral or Backtick is for Javascript string combination. *
For an example,

const myFunc = (parameter1, parameter2) => {return `This will result in combination of this paramter 1 value = ${parameter1}  and parameter2 value = ${parameter2}  when executed in console.`}

myFunc(1,2);
Enter fullscreen mode Exit fullscreen mode

Remember below things while using Template Literral.

To escap backtick in Template literral use backslash() for e.g.

const myFunc = () => {return `This is an example of back tick include in this string here next to me \` and it will work.`}

myFunc();
Enter fullscreen mode Exit fullscreen mode

Top comments (0)