{"id":11912,"date":"2021-02-09T17:34:55","date_gmt":"2021-02-10T01:34:55","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=11912"},"modified":"2023-12-01T04:08:55","modified_gmt":"2023-12-01T12:08:55","slug":"javascript-try-catch","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/","title":{"rendered":"JavaScript Try Catch: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>JavaScript try catch blocks are error handlers. The &#8220;try&#8221; block contains the code you want to test. &#8220;catch&#8221; contains code that will run if the code in your &#8220;try&#8221; block cannot execute successfully.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>When developers are testing their programs, it\u2019s common to write code that handles errors in a certain way. This is more graceful than allowing the program to crash, which would cause a programming error to appear in their program. For example, you may want the user to see a message, \u201cPlease try again later,\u201d rather than a long error log.<\/p>\n\n\n\n<p>That\u2019s where the try\/catch blocks come in. Try\/catch blocks allow you to handle errors gracefully so that coding problems don\u2019t crash the entire program. In this guide, we\u2019ll demonstrate how to use try\/catch blocks and discuss how they\u2019re useful.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Error Handling Refresher<\/h2>\n\n\n\n<p>Every developer makes mistakes in their code because there are so many ways in which a program can break.<\/p>\n\n\n\n<p>When an error is encountered in JavaScript, the program usually stops and prints the error to the console. This is useful because you can see what\u2019s wrong, but users who encounter the error aren\u2019t likely to understand it.<\/p>\n\n\n\n<p>That\u2019s why it\u2019s important to include error handling procedures in your code. By including an error handler, you can customize how your program responds if an error is encountered. Thus, error handlers allow you to decide what messages users see when an error is encountered, or how you are notified of a problem.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>JavaScript try catch<\/strong><\/h2>\n\n\n\n<p>The JavaScript try catch block identifies errors in a specified block of code. The contents of the &#8220;catch&#8221; block run if there is an error in the code in your &#8220;try&#8221; block. You can also use a &#8220;finally&#8221; block to run code whether your program executes successfully.<\/p>\n\n\n\n<p>Here is the syntax for a try\/catch procedure:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>try {\n\t\/\/ Your code here\n\tconsole.log(\u201cThe code works!\u201d);\n} catch (e) {\n\tconsole.log(\u201cThere is a problem in my code!\u201d);\n}<\/pre><\/div>\n\n\n\n<p>There are two statements in our block:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>try {}.<\/li><li>catch (e) {}.<\/li><\/ul>\n\n\n\n<p>The code enclosed in the &#8220;try&#8221; statement is what the program will attempt to run. In this case, our program attempts to print &#8220;<em>This code works&#8221;<\/em> to the console. The code enclosed in the <em>catch<\/em> statement runs if and when an error is returned in your <em>try<\/em> statement.<\/p>\n\n\n\n<p>The (e) value in the catch statement represents the error that caused the code in your &#8220;try&#8221; statement to fail. You may decide to print out the value of &#8220;e&#8221; so you can see the root cause of the error that stopped your code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">try catch JavaScript Example<\/h2>\n\n\n\n<p>To illustrate the try\/catch blocks in action, let\u2019s use an example. In the example below, we misspelled a <a href=\"https:\/\/careerkarma.com\/blog\/javascript-variables\/\">JavaScript variable<\/a> name in our code.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let ourVariable = \u201cTest\u201d;\nconsole.log(ourVarible);<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>ReferenceError: ourVarible is not defined<\/pre><\/div>\n\n\n\n<p>This is the default error returned when a variable cannot be found. But what if the user were to see this error? They would likely be confused. Now let\u2019s try our code using a try\/catch block:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let ourVariable = \u201cTest\u201d;\ntry {\nconsole.log(ourVarible);\n} catch (e) {\n\tconsole.log(\u201cThere is a problem!\u201d)\n}<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>There is a problem!<\/pre><\/div>\n\n\n\n<p>Our code contains the same ReferenceError as we have seen above. But instead of returning the lengthy and complex default error, our program returns what we specified in the <em>catch<\/em> block. Our code logs the error, but the program returns our custom error instead.<\/p>\n\n\n\n<p>The catch block keeps track of our error in the argument \u201ce,&#8221; If we wanted, we can still access the error that was returned. Here\u2019s an example of a program that returns the value \u201ce\u201d:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let ourVariable = \u201cTest\u201d;\ntry {\nconsole.log(ourVarible);\n} catch (e) {\n\tconsole.log(\u201cThere is a problem! Here is the error message from the code:\u201d, e)\n}<\/pre><\/div>\n\n\n\n<p>Our code returns the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>There is a problem! Here is the error message from the code: ReferenceError: ourVarible is not defined.<\/pre><\/div>\n\n\n\n<p>Now our code reports an error to us and also shows the error message thrown by the program.<\/p>\n\n\n\n<p>It\u2019s worth noting that <em>catch<\/em> clauses are optional. If you want your program to do nothing if an error is encountered, you only need to enclose your code in a <em>try<\/em> block.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript try catch finally Clause<\/h2>\n\n\n\n<p>There is one more clause we can add to our code: finally. <em>Finally,<\/em> is an optional clause like <em>catch<\/em>, and allows us to run code even when an error is encountered. Here\u2019s an example of a try\/catch\/finally clause in action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let ourVariable = &quot;Test&quot;;\ntry {\nconsole.log(ourVarible);\n} catch (e) {\nconsole.log(&quot;There is a problem! Here is the error message from the code:&quot;, e)\n} finally {\n\tconsole.log(&quot;The code has been run!&quot;)\n}<\/pre><\/div>\n\n\n\n<p>Here is what our program returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>TypeError: Your variable is not a string!\nThe code has been run!<\/pre><\/div>\n\n\n\n<p>Our code encounters an error so the code within our <em>catch<\/em> clause is run. This returns the TypeError that we see above. After the error has been handled, the code in our <em>finally<\/em> block is run, which prints out <em>This code has been run!<\/em><\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/repl.it\/@careerkarma\/JavaScript-Try-Catch?lite=true\" width=\"100%\" height=\"400px\" frameborder=\"0\"><\/iframe>\n<br>\n<br>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>You can use JavaScript try\/catch clauses to test out your code. The contents of a catch statement will run if your try statement cannot execute successfully. A finally statement executes immediately after either the try or catch statements.<\/p>\n\n\n\n<p>If you are developing a site that users will see, having custom errors can be useful. Custom errors will make sure users don\u2019t get confused when something goes wrong.<\/p>\n\n\n\n<p>Do you want to learn more about coding in JavaScript? Read our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-javascript\/\">How to Learn JavaScript guide<\/a>. This guide contains top advice on how to learn JavaScript.<\/p>\n","protected":false},"excerpt":{"rendered":"JavaScript try catch blocks are error handlers. The \"try\" block contains the code you want to test. \"catch\" contains code that will run if the code in your \"try\" block cannot execute successfully. When developers are testing their programs, it\u2019s common to write code that handles errors in a certain way. This is more graceful&hellip;","protected":false},"author":240,"featured_media":12337,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[12687],"class_list":{"0":"post-11912","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript","8":"tag-tutorial"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"JavaScript","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>JavaScript Try Catch: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Try\/catch clauses handle errors more gracefully in JavaScript and ensure a bug does not crash a program. Learn more in this article.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Try Catch: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Try\/catch clauses handle errors more gracefully in JavaScript and ensure a bug does not crash a program. Learn more in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-10T01:34:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:08:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Try Catch: A Step-By-Step Guide\",\"datePublished\":\"2021-02-10T01:34:55+00:00\",\"dateModified\":\"2023-12-01T12:08:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/\"},\"wordCount\":829,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg\",\"keywords\":[\"tutorial\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/\",\"name\":\"JavaScript Try Catch: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg\",\"datePublished\":\"2021-02-10T01:34:55+00:00\",\"dateModified\":\"2023-12-01T12:08:55+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Try\/catch clauses handle errors more gracefully in JavaScript and ensure a bug does not crash a program. Learn more in this article.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg\",\"width\":1200,\"height\":675,\"caption\":\"JavaScript Try Catch\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/careerkarma.com\/blog\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Try Catch: A Step-By-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"JavaScript Try Catch: A Step-By-Step Guide | Career Karma","description":"Try\/catch clauses handle errors more gracefully in JavaScript and ensure a bug does not crash a program. Learn more in this article.","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:\/\/careerkarma.com\/blog\/javascript-try-catch\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Try Catch: A Step-By-Step Guide","og_description":"Try\/catch clauses handle errors more gracefully in JavaScript and ensure a bug does not crash a program. Learn more in this article.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-02-10T01:34:55+00:00","article_modified_time":"2023-12-01T12:08:55+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Try Catch: A Step-By-Step Guide","datePublished":"2021-02-10T01:34:55+00:00","dateModified":"2023-12-01T12:08:55+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/"},"wordCount":829,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg","keywords":["tutorial"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/","url":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/","name":"JavaScript Try Catch: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg","datePublished":"2021-02-10T01:34:55+00:00","dateModified":"2023-12-01T12:08:55+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Try\/catch clauses handle errors more gracefully in JavaScript and ensure a bug does not crash a program. Learn more in this article.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-try-catch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/javascript-try-catch.jpg","width":1200,"height":675,"caption":"JavaScript Try Catch"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-try-catch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/careerkarma.com\/blog\/javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript Try Catch: A Step-By-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/11912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=11912"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/11912\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12337"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=11912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=11912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=11912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}