{"id":887,"date":"2013-01-21T14:09:55","date_gmt":"2013-01-21T14:09:55","guid":{"rendered":"https:\/\/ibex.tech\/javascript\/?p=887"},"modified":"2025-08-02T17:54:17","modified_gmt":"2025-08-02T16:54:17","slug":"variables-general","status":"publish","type":"post","link":"https:\/\/ibex.tech\/javascript\/javascript_memory\/variables-general","title":{"rendered":".Variables General"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Declaring Variables<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script>\n\/\/----- GLOBAL SCOPE -----\n\/\/(Need to be declared outside of a function)\nvar SomeValue = 0;\nvar SomeOtherValue;\n\n\/\/----- LOCAL SCOPE -----\nfunction MyFunction () {\n  let MyVariable = 0;\n  let MyVariable2;\n  const MyConstant = 'abc';\n\n\/\/let has block scope (can be used only within {} )\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Declaring Variables<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[],"class_list":["post-887","post","type-post","status-publish","format-standard","hentry","category-javascript_memory"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts\/887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/comments?post=887"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts\/887\/revisions"}],"predecessor-version":[{"id":4332,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/posts\/887\/revisions\/4332"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/media?parent=887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/categories?post=887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/javascript\/wp-json\/wp\/v2\/tags?post=887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}