{"id":5456,"date":"2023-01-25T12:33:09","date_gmt":"2023-01-25T17:33:09","guid":{"rendered":"https:\/\/www.cloudsurph.com\/?p=5456"},"modified":"2023-01-25T12:34:14","modified_gmt":"2023-01-25T17:34:14","slug":"javascript-variables","status":"publish","type":"post","link":"https:\/\/www.cloudsurph.com\/javascript-variables\/","title":{"rendered":"JavaScript Variables"},"content":{"rendered":"<p><span style=\"color: #333333; font-size: 22px;\">JavaScript Variables<\/span><\/p>\n<p>For any programming language has a fundamental requirement to store data in memory such that computations can be performed on it.<\/p>\n<p>And the memory location requires a name to store and retrieve this data, and this name is \u201cVariable.\u201d<\/p>\n<p>Basically, only one type of data can be stored in each memory location. <em><strong>IF you want then buy a good, reliable, secure web\u00a0<a href=\"https:\/\/www.cloudsurph.com\/windows-vps-hosting\/\">hosting<\/a>\u00a0service \u00a0from here:\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">click here<\/a><\/strong><\/em><\/p>\n<p>Also, the variable \u201c<strong>DataType<\/strong>\u201d helps to determine this each programming language permits the definition and declaration of variables of particular data types because it must perform some computation, and JavaScript is no exception.<\/p>\n<h3>What are JavaScript Variables?<\/h3>\n<p>Firstly, anything that can change is considered to be a variable and a variable in JavaScript saves data that can be modified later.<\/p>\n<h4>Check our previous Article:<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.cloudsurph.com\/javascript-operators\/\" aria-current=\"page\">JavaScript Operators<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/creating-an-object-in-javascript\/\">Creating an Object in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/what-is-asynchronous-javascript\/\">Introduction to Asynchronous JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/what-is-control-flow-in-javascript\/\">Control Flow in JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/www.cloudsurph.com\/javascript-application-development\/\">JavaScript Application Development<\/a><\/li>\n<\/ul>\n<p>Secondly, the variable is uniquely identified by its name,<\/p>\n<p>Thirdly, the value pertains to the information kept in the variable, and<\/p>\n<p>Fourthly, the variable\u2019s memory location is indicated by the memory address.<\/p>\n<h3>How to Declare a Variable in JavaScript?<\/h3>\n<p>In JavaScript, defining a variable is referred to as \u201cDeclaring\u201d a variable, and additionally, the \u201cvar\u201d keyword is utilized to declare the variable.<\/p>\n<p>So, the JavaScript keywords var, let, and const can be used to declare the variables described below:<\/p>\n<h5><em><strong>You can purchase your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting from Cloudsurph.com<\/a>,\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">Cloudsurph hosting<\/a>\u00a0is a reliable hosting option for business and personal projects. We offer insight and help on system configuration issues and code errors or bugs<\/strong>.<\/em><\/h5>\n<p><strong>Var:<\/strong> the var keyword has been used to declare variables since JavaScript was developed. So, it is unclear and prone to error when variables are declared using var.<\/p>\n<p><strong>Let:<\/strong> In JavaScript let keyword gets rid of var\u2019s ambiguity and error. The new and advised method of declaring variables for JavaScript.<\/p>\n<p><strong>Const:<\/strong> In JavaScript, a constant variable is one that is given a value, cannot be modified, and is declared with the const keyword.<\/p>\n<h3>Rules for Establishing JavaScript Variables<\/h3>\n<p>A few of these laws include are below:<\/p>\n<p><strong>First:<\/strong> The first character of a variable name must be a letter, an underscore (_), or a dollar symbol ($).<\/p>\n<p><strong>Second:<\/strong> You can use numbers after the initial letter, underline, or dollar.<\/p>\n<p><strong>Third:<\/strong> Spaces are not permitted in variable names.<\/p>\n<p><strong>Fourth:<\/strong> JavaScript class variables are case-sensitive.<\/p>\n<p><strong>Fifth:<\/strong> Reserved words, such as abstract, final, etc., cannot be used as variable names.<\/p>\n<p><strong>Sixth:<\/strong> The script&gt; tag allows JavaScript code to be included in an HTML document.<\/p>\n<pre class=\"prettyprint\">\r\n\/\/ Valid variables\r\nvar test1 = 10; \/\/ Started with letter\r\nvar\u00a0 _test = \u201cDemo\u201d; \/\/ Started with UnderScore(_)\r\nvar $test1 = true; \/\/ Started with dollar sign($)\r\n\r\n\/\/ Invalid variables\r\nvar 1test = 10; \/\/ Started with letter 1\r\nvar *test = \u201cvalue\u201d; \/\/ Started with special character(*)\r\n<\/pre>\n<h3>What Is the Scope of JavaScript Variables?<\/h3>\n<p><strong>Local Scope:<\/strong> JavaScript environment variables fall under the local scope when they are declared inside a function, method, or block. So, in this methods\/functions are the only places where these variables can be accessed.<\/p>\n<pre class=\"prettyprint\">\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\r\n\u00a0 \u00a0 \u00a0 &lt;script type = \"text\/JavaScript\"&gt;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 function checkVariable( ) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ local variable just accessed in this feature\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0myVar = \"ToolsQA\";\r\n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0document.write(myVar);\r\n \u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0&lt;\/script&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body onload = checkVariable()&gt;\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Now, consider the following scenario when a user wants to access a local variable specified in one method from another method like the below:<\/p>\n<pre class=\"prettyprint\">\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;script type=\"text\/JavaScript\"&gt;\r\nfunction checkVariable( ) {\r\n\/\/ local variable declaration and setup\r\nvar myVar = \"ToolsQA\";\r\n}\r\n\r\nfunction clickButton(){\r\n\/\/ try accessing local variable in another method\r\nalert(myVar);\r\n}\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body onload=checkVariable()&gt;\r\n&lt;button onclick=\"clickButton()\"&gt;Click me&lt;\/button&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Global Scope:<\/strong> In JavaScript, variables declared outside of all the functions or methods are referred to as global variables and are accessible to all methods, functions, and blocks. For instance, in the code excerpt like below:<\/p>\n<pre class=\"prettyprint\">\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;script type=\"text\/JavaScript\"&gt;\r\n\/\/this is the global variable, and it can be accessed in all the functions\r\nvar myVar;\r\nfunction checkVariable( ) {\r\n\/\/ Assign value to the global variable\r\nmyVar = \"ToolsQA\";\r\n}\r\n\r\nfunction clickButton(){\r\n\/\/ Print value of the global variable\r\nalert(myVar);\r\n}\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body onload=checkVariable()&gt;\r\n&lt;button onclick=\"clickButton()\"&gt;Click me&lt;\/button&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>Conclusion<\/h3>\n<p>Lastly, a JavaScript variable is the name of a storage location. It is a label for a value, such as a string or a number.<\/p>\n<p>However, we need to must declare a variable before using it. Now we know that the basics of JavaScript variables, don\u2019t be afraid to use them in our projects.<\/p>\n<p>That\u2019s it. If you enjoyed reading this article and have more questions please reach out to our\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/submitticket.php?step=2&amp;deptid=1\">support team<\/a>\u00a0via live chat or\u00a0<a href=\"mailto:support@cloudsurph.com\">email<\/a>\u00a0and we would be glad to help you. we provide server\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">hosting<\/a>\u00a0for all types of need and we can even get your\u00a0<a href=\"https:\/\/hosting.cloudsurph.com\/\">server<\/a>\u00a0up and running with the service of your choice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript Variables For any programming language has a fundamental requirement to store data in memory such that computations can be performed on it. And the memory location requires a name to store and retrieve this data, and this name is \u201cVariable.\u201d Basically, only one type of data can be stored in each memory location. IF [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":5457,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[157,162,158,159,44,1],"tags":[54,47,105,103,48,113],"class_list":["post-5456","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos-7","category-javascript","category-linux-basics","category-linux-server","category-kvm-xen","category-virtual-private-servers","tag-best-vps-hosting-server-maryland","tag-cheap-cloud-servers","tag-cheap-storage-server-hosting","tag-cheapest-vps","tag-dedicated-server-hosting-in-washington-d-c","tag-speed-test-vps"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are JavaScript Variables?<\/title>\n<meta name=\"description\" content=\"JavaScript Variables, What are JavaScript Variables, Declare a Variable in JavaScript, Scope of JavaScript Variables\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudsurph.com\/javascript-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are JavaScript Variables?\" \/>\n<meta property=\"og:description\" content=\"JavaScript Variables, What are JavaScript Variables, Declare a Variable in JavaScript, Scope of JavaScript Variables\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudsurph.com\/javascript-variables\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudsurph Web Hosting Washington D.C.\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/CloudSurph\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-25T17:33:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-25T17:34:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/01\/What-are-JavaScript-Variables.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1264\" \/>\n\t<meta property=\"og:image:height\" content=\"760\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rony\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cloudsurph\" \/>\n<meta name=\"twitter:site\" content=\"@Cloud_Surph\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rony\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/\"},\"author\":{\"name\":\"Rony\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\"},\"headline\":\"JavaScript Variables\",\"datePublished\":\"2023-01-25T17:33:09+00:00\",\"dateModified\":\"2023-01-25T17:34:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/\"},\"wordCount\":644,\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/What-are-JavaScript-Variables.jpg\",\"keywords\":[\"Best VPS hosting server Maryland\",\"Cheap Cloud Servers\",\"Cheap Storage Server Hosting\",\"Cheapest VPS\",\"Dedicated Server Hosting in Washington D.C\",\"Speed test VPS\"],\"articleSection\":[\"CentOS 7\",\"JavaScript\",\"Linux Basics\",\"Linux Server\",\"Virtualization\",\"VPS Servers\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/\",\"name\":\"What are JavaScript Variables?\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/What-are-JavaScript-Variables.jpg\",\"datePublished\":\"2023-01-25T17:33:09+00:00\",\"dateModified\":\"2023-01-25T17:34:14+00:00\",\"description\":\"JavaScript Variables, What are JavaScript Variables, Declare a Variable in JavaScript, Scope of JavaScript Variables\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/What-are-JavaScript-Variables.jpg\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/What-are-JavaScript-Variables.jpg\",\"width\":1264,\"height\":760,\"caption\":\"JavaScript Variables\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/javascript-variables\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudsurph.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript Variables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#website\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"name\":\"Cloudsurph Web Hosting Washington D.C.\",\"description\":\"Dedicated Server Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.cloudsurph.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#organization\",\"name\":\"CloudSurph Technology Solutions\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.cloudsurph.com\\\/wp-content\\\/uploads\\\/2016\\\/04\\\/cloudsurph-logo.png\",\"width\":2348,\"height\":1692,\"caption\":\"CloudSurph Technology Solutions\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/CloudSurph\\\/\",\"https:\\\/\\\/x.com\\\/Cloud_Surph\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.cloudsurph.com\\\/#\\\/schema\\\/person\\\/ac9b4dd136d96e50d5f29c560191e7ed\",\"name\":\"Rony\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g\",\"caption\":\"Rony\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cloudsurph\"],\"url\":\"https:\\\/\\\/www.cloudsurph.com\\\/author\\\/ron\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are JavaScript Variables?","description":"JavaScript Variables, What are JavaScript Variables, Declare a Variable in JavaScript, Scope of JavaScript Variables","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:\/\/www.cloudsurph.com\/javascript-variables\/","og_locale":"en_US","og_type":"article","og_title":"What are JavaScript Variables?","og_description":"JavaScript Variables, What are JavaScript Variables, Declare a Variable in JavaScript, Scope of JavaScript Variables","og_url":"https:\/\/www.cloudsurph.com\/javascript-variables\/","og_site_name":"Cloudsurph Web Hosting Washington D.C.","article_publisher":"https:\/\/www.facebook.com\/CloudSurph\/","article_published_time":"2023-01-25T17:33:09+00:00","article_modified_time":"2023-01-25T17:34:14+00:00","og_image":[{"width":1264,"height":760,"url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/01\/What-are-JavaScript-Variables.jpg","type":"image\/jpeg"}],"author":"Rony","twitter_card":"summary_large_image","twitter_creator":"@cloudsurph","twitter_site":"@Cloud_Surph","twitter_misc":{"Written by":"Rony","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/#article","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/"},"author":{"name":"Rony","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed"},"headline":"JavaScript Variables","datePublished":"2023-01-25T17:33:09+00:00","dateModified":"2023-01-25T17:34:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/"},"wordCount":644,"publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"image":{"@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/01\/What-are-JavaScript-Variables.jpg","keywords":["Best VPS hosting server Maryland","Cheap Cloud Servers","Cheap Storage Server Hosting","Cheapest VPS","Dedicated Server Hosting in Washington D.C","Speed test VPS"],"articleSection":["CentOS 7","JavaScript","Linux Basics","Linux Server","Virtualization","VPS Servers"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/","url":"https:\/\/www.cloudsurph.com\/javascript-variables\/","name":"What are JavaScript Variables?","isPartOf":{"@id":"https:\/\/www.cloudsurph.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/01\/What-are-JavaScript-Variables.jpg","datePublished":"2023-01-25T17:33:09+00:00","dateModified":"2023-01-25T17:34:14+00:00","description":"JavaScript Variables, What are JavaScript Variables, Declare a Variable in JavaScript, Scope of JavaScript Variables","breadcrumb":{"@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudsurph.com\/javascript-variables\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/#primaryimage","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/01\/What-are-JavaScript-Variables.jpg","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2023\/01\/What-are-JavaScript-Variables.jpg","width":1264,"height":760,"caption":"JavaScript Variables"},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudsurph.com\/javascript-variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudsurph.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript Variables"}]},{"@type":"WebSite","@id":"https:\/\/www.cloudsurph.com\/#website","url":"https:\/\/www.cloudsurph.com\/","name":"Cloudsurph Web Hosting Washington D.C.","description":"Dedicated Server Hosting","publisher":{"@id":"https:\/\/www.cloudsurph.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cloudsurph.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cloudsurph.com\/#organization","name":"CloudSurph Technology Solutions","url":"https:\/\/www.cloudsurph.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","contentUrl":"https:\/\/www.cloudsurph.com\/wp-content\/uploads\/2016\/04\/cloudsurph-logo.png","width":2348,"height":1692,"caption":"CloudSurph Technology Solutions"},"image":{"@id":"https:\/\/www.cloudsurph.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/CloudSurph\/","https:\/\/x.com\/Cloud_Surph"]},{"@type":"Person","@id":"https:\/\/www.cloudsurph.com\/#\/schema\/person\/ac9b4dd136d96e50d5f29c560191e7ed","name":"Rony","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/40163fe1eb49d5eddd81954e8ad5122633e141df15b0733d07fbe4a156688ba5?s=96&d=mm&r=g","caption":"Rony"},"sameAs":["https:\/\/x.com\/cloudsurph"],"url":"https:\/\/www.cloudsurph.com\/author\/ron\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/comments?post=5456"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5456\/revisions"}],"predecessor-version":[{"id":5458,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/posts\/5456\/revisions\/5458"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media\/5457"}],"wp:attachment":[{"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/media?parent=5456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/categories?post=5456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudsurph.com\/wp-json\/wp\/v2\/tags?post=5456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}