{"id":2653,"date":"2019-04-24T13:38:57","date_gmt":"2019-04-24T19:38:57","guid":{"rendered":"http:\/\/alliwalk.com\/blog\/?p=2653"},"modified":"2019-04-24T14:48:49","modified_gmt":"2019-04-24T20:48:49","slug":"stuff-i-learned-about-debugging-on-freecodecamp","status":"publish","type":"post","link":"https:\/\/alliwalk.com\/blog\/2019\/04\/stuff-i-learned-about-debugging-on-freecodecamp\/","title":{"rendered":"Stuff I learned about Debugging on FreeCodeCamp"},"content":{"rendered":"<p>I recently got through the Debugging set of lessons on FreeCodeCamp. Here are a few points I learned.<\/p>\n<h5>Error Types<\/h5>\n<p><strong>There are 3 types of errors:<\/strong><\/p>\n<ul>\n<li>Syntax &#8211; misspelled word, missing parentheses, etc.<\/li>\n<li>Runtime &#8211; detected while running the program.<\/li>\n<li>Semantic &#8211; detected after testing output. Program works but result is wrong. Be careful!<\/li>\n<\/ul>\n<h5>Short List<\/h5>\n<p>1. Use <strong>DevTools<\/strong> on Chrome or Firefox<\/p>\n<p>2. <strong>Use <code>console.log();<\/code> a lot.<\/strong> <code>console.log<\/code> spits out the value of whatever is in the <code>()<\/code> to the browser console, which helps you keep tabs on how a value is changing in your code. Sometimes you have to move the <code>console.log<\/code> to a different place, like before or after another function, because order matters and the value of your value can change.<\/p>\n<p>3. <strong><code>Use console.clear();<\/code><\/strong> to clear the memory of a value in the console. Sometimes it\u2019s ok to forget.<\/p>\n<p>4. <strong>Use <code>typeof<\/code> to keep track of values<\/strong>. For instance sometimes a number is a numeral and sometimes it\u2019s a string. Write <code>console.log(typeof value);<\/code> and that will tell you the type for value.<\/p>\n<p>5. Lastly, you have to <strong>watch out<\/strong> for misspellings, missing brackets or parentheses, using \u2018=\u2018 instead of \u2018==\u2018, or getting the dreaded infinite loop.<\/p>\n<hr \/>\n<p>Next in FreeCodeCamp is <em>Data Structures!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently got through the Debugging set of lessons on FreeCodeCamp. Here are a few points I learned. Error Types There are 3 types of errors: Syntax &#8211; misspelled word, missing parentheses, etc. Runtime &#8211; detected while running the program. Semantic &#8211; detected after testing output. Program works but result is wrong. Be careful! Short &hellip; <a href=\"https:\/\/alliwalk.com\/blog\/2019\/04\/stuff-i-learned-about-debugging-on-freecodecamp\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Stuff I learned about Debugging on FreeCodeCamp&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2667,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,1],"tags":[516,518,517,512,325],"_links":{"self":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts\/2653"}],"collection":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/comments?post=2653"}],"version-history":[{"count":3,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts\/2653\/revisions"}],"predecessor-version":[{"id":2668,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/posts\/2653\/revisions\/2668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/media\/2667"}],"wp:attachment":[{"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/media?parent=2653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/categories?post=2653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alliwalk.com\/blog\/wp-json\/wp\/v2\/tags?post=2653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}