{"id":3892,"date":"2023-03-02T14:25:17","date_gmt":"2023-03-02T19:25:17","guid":{"rendered":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/?p=3892"},"modified":"2023-03-02T14:25:17","modified_gmt":"2023-03-02T19:25:17","slug":"javascript-variables-and-more","status":"publish","type":"post","link":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/2023\/03\/02\/javascript-variables-and-more\/","title":{"rendered":"JavaScript Variables and More!"},"content":{"rendered":"<p><span style=\"font-weight: 400\">JavaScript is a scripting language used to create web page content. Within JavaScript, there are variables that are basically a location that holds values. There are two ways to declare a variable in JavaScript. In class, we used \u201clet\u201d as the keyword, but you could also use \u201cvar\u201d to declare a variable. The \u201cHello World\u201d assignment we did in class together is a good example of declaring variables but more importantly understanding when a variable is initialized. To initialize a variable by giving it value. To do so your variable is then followed by an assignment operator. In the assignment we did together, we first coded \u201clet myText\u201d which is only declared, but when we added it, the new code read, \u201clet myText = \u201cHello, World\u201d which made a variable change from declared to initialized. The equal sign is the assignment operator in this example. Some key things to remember when naming your variable is that it must start with a letter, underscore, or character but NOT a number. They can be as simple as one word or as long as you need but it is important to note that spaces are not allowed when naming your variables.\u00a0 In many other coding assignments we had, we also used arithmetic operators. An arithmetic operator is an operator that performs the operation selected on the groups or numbers. The main <img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3893 alignright\" src=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/javascript_logo.png\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/javascript_logo.png 300w, https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/files\/2023\/03\/javascript_logo-150x150.png 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>ones we used were &#8220;+\u201d which is addition, \u201c-\u201d which is subtraction, \u201c*\u201d which is multiplication, and \u201c\/\u201d which is used for division. There are other arithmetic operations as well but these were the ones we mostly used. When using arithmetic operators remember to use order of operations to ensure that JavaScript reads it properly and gives the answer you need. One of the last key things we learned how to use is concatenation operators which allows us to string two strings together.\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript is a scripting language used to create web page content. Within JavaScript, there are variables that are basically a location that holds values. There are two ways to declare a variable in JavaScript. In class, we used \u201clet\u201d as the keyword, but you could also use \u201cvar\u201d to declare a variable. The \u201cHello World\u201d [&hellip;]<\/p>\n","protected":false},"author":29245,"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-3892","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\/3892","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\/29245"}],"replies":[{"embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/comments?post=3892"}],"version-history":[{"count":1,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3892\/revisions"}],"predecessor-version":[{"id":3894,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/posts\/3892\/revisions\/3894"}],"wp:attachment":[{"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/media?parent=3892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/categories?post=3892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/community.mis.temple.edu\/mis2101sec730spring2023\/wp-json\/wp\/v2\/tags?post=3892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}