{"id":217207,"date":"2019-12-30T09:25:40","date_gmt":"2019-12-30T09:25:40","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=217207"},"modified":"2019-12-30T09:25:41","modified_gmt":"2019-12-30T09:25:41","slug":"template-string","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/template-string\/","title":{"rendered":"Template String"},"content":{"rendered":"\n<p>Today we will talk about <strong>Template String<\/strong> and how can we use it in our javascript program.<\/p>\n\n\n\n<p><strong>Introduction<\/strong><\/p>\n\n\n\n<p>Template String introduces in Ecma Script 6 (ES6) in 2015. It is the different type of expression where we can concatenate our string in the single variable. The template string is enclosed by the back-tick character (<strong>&#8220;<\/strong>) instead of single or double-quotes.<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\nlet name = &quot;Akhil&quot;;\nlet age = 24;\nlet address = &quot;India&quot;;\nconsole.log(&quot;Hello My name is &quot; + name + &quot; and I am &quot; + age + &quot; years old and I am from &quot; + address);\n\nOutput:- Hello My name is Akhil and I am 24 years old and I am from India<\/pre>\n\n\n\n<p>On the above example, we need to display the Name, age, address in a single line and for doing that we have concatenated the variable multiple time by using double quotes open and closed with arithmetic (+) operator  <\/p>\n\n\n\n<p>Let&#8217;s check the same example using string template<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\nlet name = &quot;Akhil&quot;;\nlet age = 24;\nlet address = &quot;India&quot;;\nconsole.log(`Hello My name is ${name} and I am ${age} Years old and I am from ${address}`);\n\nOutput:- Hello My name is Akhil and I am 24 years old and I am from India<\/pre>\n\n\n\n<p>In this example, you can see how concatinating is going to easy there is no need to use an arithmetic operator or double quotes open and close. It will very helpful when you write the dynamic html code in javascript.<\/p>\n\n\n\n<p>I hope you enjoyed this article, we will have some more useful articles in the future which will be helpful for the developer\u2019 daily coding life.<\/p>\n\n\n\n<p>I will see you again with the new topic and have a great day!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we will talk about Template String and how can we use it in our javascript program. Introduction Template String introduces in Ecma Script 6 (ES6) in 2015. It is the different type of expression where we can concatenate our string in the single variable. The template string is enclosed by the back-tick character (&#8220;) <a href=\"https:\/\/webkul.com\/blog\/template-string\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":222,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2383,1],"tags":[],"class_list":["post-217207","post","type-post","status-publish","format-standard","hentry","category-blog","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Template String - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/template-string\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Template String - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Today we will talk about Template String and how can we use it in our javascript program. Introduction Template String introduces in Ecma Script 6 (ES6) in 2015. It is the different type of expression where we can concatenate our string in the single variable. The template string is enclosed by the back-tick character (&#8220;) [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/template-string\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-30T09:25:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-30T09:25:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Akhilesh Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Akhilesh Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/template-string\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/template-string\/\"},\"author\":{\"name\":\"Akhilesh Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f3c6faccc651392ee113400a2f5d0704\"},\"headline\":\"Template String\",\"datePublished\":\"2019-12-30T09:25:40+00:00\",\"dateModified\":\"2019-12-30T09:25:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/template-string\/\"},\"wordCount\":184,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"articleSection\":[\"blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/template-string\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/template-string\/\",\"url\":\"https:\/\/webkul.com\/blog\/template-string\/\",\"name\":\"Template String - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2019-12-30T09:25:40+00:00\",\"dateModified\":\"2019-12-30T09:25:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/template-string\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/template-string\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/template-string\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Template String\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f3c6faccc651392ee113400a2f5d0704\",\"name\":\"Akhilesh Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a488fc7f6a8850e8b8b9585469192b125f44d289c60009655cb84d15153c21ac?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a488fc7f6a8850e8b8b9585469192b125f44d289c60009655cb84d15153c21ac?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Akhilesh Kumar\"},\"description\":\"Akhilesh Kumar is a seasoned professional with 5 years of expertise in WordPress WooCommerce module development, marketplace development, and API development. With a strong foundation in e-commerce technologies, Akhilesh excels in crafting robust solutions to meet diverse business needs, driving success in online retail venture\",\"url\":\"https:\/\/webkul.com\/blog\/author\/akhileshkumar-oc765\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Template String - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/template-string\/","og_locale":"en_US","og_type":"article","og_title":"Template String - Webkul Blog","og_description":"Today we will talk about Template String and how can we use it in our javascript program. Introduction Template String introduces in Ecma Script 6 (ES6) in 2015. It is the different type of expression where we can concatenate our string in the single variable. The template string is enclosed by the back-tick character (&#8220;) [...]","og_url":"https:\/\/webkul.com\/blog\/template-string\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2019-12-30T09:25:40+00:00","article_modified_time":"2019-12-30T09:25:41+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Akhilesh Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Akhilesh Kumar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/template-string\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/template-string\/"},"author":{"name":"Akhilesh Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f3c6faccc651392ee113400a2f5d0704"},"headline":"Template String","datePublished":"2019-12-30T09:25:40+00:00","dateModified":"2019-12-30T09:25:41+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/template-string\/"},"wordCount":184,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"articleSection":["blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/template-string\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/template-string\/","url":"https:\/\/webkul.com\/blog\/template-string\/","name":"Template String - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2019-12-30T09:25:40+00:00","dateModified":"2019-12-30T09:25:41+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/template-string\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/template-string\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/template-string\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Template String"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f3c6faccc651392ee113400a2f5d0704","name":"Akhilesh Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a488fc7f6a8850e8b8b9585469192b125f44d289c60009655cb84d15153c21ac?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a488fc7f6a8850e8b8b9585469192b125f44d289c60009655cb84d15153c21ac?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Akhilesh Kumar"},"description":"Akhilesh Kumar is a seasoned professional with 5 years of expertise in WordPress WooCommerce module development, marketplace development, and API development. With a strong foundation in e-commerce technologies, Akhilesh excels in crafting robust solutions to meet diverse business needs, driving success in online retail venture","url":"https:\/\/webkul.com\/blog\/author\/akhileshkumar-oc765\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/217207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/222"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=217207"}],"version-history":[{"count":6,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/217207\/revisions"}],"predecessor-version":[{"id":217437,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/217207\/revisions\/217437"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=217207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=217207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=217207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}