{"id":19368,"date":"2016-12-30T19:10:17","date_gmt":"2016-12-30T19:10:17","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=19368"},"modified":"2016-12-30T19:10:18","modified_gmt":"2016-12-30T19:10:18","slug":"javascript-literal-string-with-the-concat-function","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/javascript-literal-string-with-the-concat-function\/","title":{"rendered":"JavaScript:  literal string with the concat() function"},"content":{"rendered":"<h1>The tutor shares an observation about the concat() function.<\/h1>\n<p>The concat() function is used to join one or more strings to the end of another:<\/p>\n<p style=\"color:#555500;font-size:110%\">\nvar strng0 = &#8220;This string, &#8220;;<br \/>\nvar strng1 = &#8220;then this one&#8221;<br \/>\nvar strng2 = &#8220;:)&#8221;<br \/>\nvar strng3 = strng0.concat(strng1,strng2);<br \/>\ndocument.getElementById(&#8220;output&#8221;).innerHTML = strng3;\n<\/p>\n<p>will display<\/p>\n<p style=\"font-family:monospace;font-size:120%\">This string, then this one:)<\/p>\n<p>In my experience, a literal string can also be used at the front:<\/p>\n<p style=\"color:#555500;font-size:110%\">\nvar strng_a = &#8220;then this one&#8221;<br \/>\nvar strng_b = &#8220;:)&#8221;<br \/>\nvar strng_c = &#8220;This string, &#8220;.concat(strng_a,strng_b);<br \/>\ndocument.getElementById(&#8220;output&#8221;).innerHTML = strng_c;\n<\/p>\n<p>will also display<\/p>\n<p style=\"font-family:monospace;font-size:120%\">This string, then this one:)<\/p>\n<p>Source:<\/p>\n<p><a href=\"http:\/\/www.w3schools.com\/jsref\/jsref_concat_string.asp\">www.w3schools.com<\/a><\/p>\n<p>Jack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The tutor shares an observation about the concat() function. The concat() function is used to join one or more strings to the end of another: var strng0 = &#8220;This string, &#8220;; var strng1 = &#8220;then this one&#8221; var strng2 = &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/javascript-literal-string-with-the-concat-function\/\"> <span class=\"screen-reader-text\">JavaScript:  literal string with the concat() function<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,1713,1745,837],"tags":[1824,2084],"class_list":["post-19368","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-javascript","category-javascript-computer-science","category-web-design","tag-javascript-concat","tag-javascript-string-concatentation-with-literal-string"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/19368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=19368"}],"version-history":[{"count":15,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/19368\/revisions"}],"predecessor-version":[{"id":19383,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/19368\/revisions\/19383"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=19368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=19368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=19368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}