{"id":323,"date":"2018-03-16T04:46:42","date_gmt":"2018-03-15T22:46:42","guid":{"rendered":"https:\/\/mcqacademy.com\/en\/mcq\/considering-the-following-snap-of-code-what-is-the-expected-result\/"},"modified":"2018-03-16T04:46:42","modified_gmt":"2018-03-15T22:46:42","slug":"considering-the-following-snap-of-code-what-is-the-expected-result","status":"publish","type":"mcq","link":"https:\/\/mcqacademy.com\/en\/mcq\/considering-the-following-snap-of-code-what-is-the-expected-result\/","title":{"rendered":"Considering the following snap of code, what is the expected result?"},"content":{"rendered":"<p>Considering the following snap of code, what is the expected result?<\/p>\n<pre>const gotNumber = 46;\r\nif (gotNumber&gt;45) {\r\n    var division = 'Second Division';\r\n}\r\nconsole.log(`Division is ${division} by number ${gotNumber}`);<\/pre>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","topic":[155],"subject":[17],"education_level":[],"class_list":["post-323","mcq","type-mcq","status-publish","hentry","topic-ecmascript-6-es6","subject-javascript"],"mcq_note":"<pre>const gotNumber = 46;\r\nif (gotNumber&gt;45) {\r\n    var division = 'Second Division';\r\n}\r\nconsole.log(`Division is ${division} by number ${gotNumber}`);<\/pre>\r\nVariable declared by <code>var<\/code> is <strong>function scope variable<\/strong>. So the variable division is accessible out of the if condition block. Ultimately the result is: <code>Division is Second Division by number 46<\/code>","mcq_options":[{"right":"no","answer":"Error: division is not defined"},{"right":"yes","answer":"Division is Second Division by number 46"},{"right":"no","answer":"Division is  Division by number 46"},{"right":"no","answer":"Error: unexpected token: identifier"}],"multi_answers":"no","subject_terms":[{"id":17,"title":"JavaScript","slug":"javascript"}],"topic_terms":[{"id":155,"title":"EcmaScript 6 (ES6)","slug":"ecmascript-6-es6"}],"_links":{"self":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/mcq\/323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/mcq"}],"about":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/types\/mcq"}],"author":[{"embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/comments?post=323"}],"wp:attachment":[{"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/media?parent=323"}],"wp:term":[{"taxonomy":"topic","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/topic?post=323"},{"taxonomy":"subject","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/subject?post=323"},{"taxonomy":"education_level","embeddable":true,"href":"https:\/\/mcqacademy.com\/en\/wp-json\/wp\/v2\/education_level?post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}