{"id":11363,"date":"2014-01-22T15:50:22","date_gmt":"2014-01-22T10:20:22","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=11363"},"modified":"2014-01-22T15:50:22","modified_gmt":"2014-01-22T10:20:22","slug":"constants-in-javascript","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/constants-in-javascript\/","title":{"rendered":"Constants In JavaScript"},"content":{"rendered":"<p>We can create constants in JavaScript using <strong>&#8216;const&#8217;<\/strong> keyword.<br \/>\n[js]<br \/>\nconst name = &#8216;Sakshi&#8217;<br \/>\nconsole.log(name)<br \/>\n[\/js]<br \/>\nThis will print: Sakshi<br \/>\nNow, if we try to change or re-initialize &#8216;name&#8217; constant, the value will not change.<br \/>\n[js]<br \/>\nconst name = &#8216;Hello&#8217;<br \/>\nconsole.log(name)<br \/>\n[\/js]<br \/>\nThis will again print: Sakshi<\/p>\n<p><strong>Compatibility: <\/strong>&#8216;const&#8217; is supported in Firefox &amp; Chrome. Some compatibility issue with Internet Explorer 10 and lower, opera and some other browsers. It is going to be defined by ECMAScript 6 soon. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can create constants in JavaScript using &#8216;const&#8217; keyword. [js] const name = &#8216;Sakshi&#8217; console.log(name) [\/js] This will print: Sakshi Now, if we try to change or re-initialize &#8216;name&#8217; constant, the value will not change. [js] const name = &#8216;Hello&#8217; console.log(name) [\/js] This will again print: Sakshi Compatibility: &#8216;const&#8217; is supported in Firefox &amp; Chrome. [&hellip;]<\/p>\n","protected":false},"author":65,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/11363"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=11363"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/11363\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=11363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=11363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=11363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}