{"id":4150,"date":"2023-03-02T20:26:59","date_gmt":"2023-03-03T01:26:59","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=4150"},"modified":"2023-03-02T20:26:59","modified_gmt":"2023-03-03T01:26:59","slug":"variables-in-javascript-5a-3","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/variables-in-javascript-5a-3\/","title":{"rendered":"Variables in JavaScript &#8211; 5a"},"content":{"rendered":"<p>One way to simplify code in JavaScript is with the use of variables. Variables in JavaScript are storage spaces that hold values and will display those values when the variable is called. The let keyword initiates the use of a variable. While var is an older keyword for using variables, JavaScript would still recognize the use both of var and let when using variables. To use variables, you would start by implementing the let keyword followed by a name for the variable. For instance, a variable could look like let myName. In the example I just gave, the variable has only been declared since it does not contain a value. However, if I wanted to initialize the variable, I could give it a value such as let myName = \u201cAidan\u201d; Here, the variable as been initialized as it now holds a value. If I wanted to call the variable I would just print alert(myName), which would display the text of \u201cAidan\u201d. When using variables, there are some rules, or guidelines, to follow. The variable can be any length as long as one character is used, the variable can start with a letter, underscore, or even the $ character, but it cannot start with a number. After the first character, a variable ca of any combination of letters, underscores, numbers, and $ characters. Finally, spaces are not allowed within variables. Arithmetic operators can be used within JavaScript with some operators such as addition (+), subtraction (-), multiplication (*), division (\/), and modulus (%). These operators help perform mathematical equations with variables. When using these operators, PEMDAS is applied in terms of the order of operations within JavaScript.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One way to simplify code in JavaScript is with the use of variables. Variables in JavaScript are storage spaces that hold values and will display those values when the variable is called. The let keyword initiates the use of a variable. While var is an older keyword for using variables, JavaScript would still recognize the [&hellip;]<\/p>\n","protected":false},"author":29379,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[663943],"tags":[],"class_list":{"0":"post-4150","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-instructor","7":"entry"},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/users\/29379"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=4150"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4150\/revisions"}],"predecessor-version":[{"id":4168,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/4150\/revisions\/4168"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=4150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=4150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=4150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}