{"id":12490,"date":"2020-02-24T11:33:23","date_gmt":"2020-02-24T19:33:23","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12490"},"modified":"2023-12-01T02:30:19","modified_gmt":"2023-12-01T10:30:19","slug":"ruby-if-statement","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/","title":{"rendered":"Ruby If Statement"},"content":{"rendered":"\n<p>When you\u2019re programming in Ruby, you may want to run certain code only if a condition is met. For example, you may want to stop a customer from buying a product if there is no stock left in inventory, or only allow a customer to proceed with a purchase if they have filled out all the relevant forms.<\/p>\n\n\n\n<p>In order to perform these actions, we need to employ the use of an <code>if statement<\/code>. In simple terms, if statements allow Ruby programs to make decisions based on certain criteria. If a condition is met, then the program will do something.<\/p>\n\n\n\n<p>In this tutorial, we are going to break down the basics of <code>if<\/code> statements in Ruby, discuss the types of conditions you can use, and explore <code>if else<\/code> statements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ruby If Statement<\/h2>\n\n\n\n<p>If statements can be used to allow a program to make decisions based on a certain set of criteria. For example, you may want to give a customer a discount if they are a senior citizen, or if they have a coupon listed on their account.<\/p>\n\n\n\n<p>Here is the syntax for an if statement in Ruby:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if conditions_are_met\n\t\/\/ Run code\nEnd<\/pre><\/div>\n\n\n\n<p>Let\u2019s use an example to illustrate how if statements work. Let\u2019s say we have a user who is trying to buy a ticket on our online store, and we need to verify if they are 16 or older. Here\u2019s an example of an if statement that will accomplish this goal: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>user_age = 17\nif user_age &lt; 16\n\tputs \"You are not old enough to use this service.\"\nEnd<\/pre><\/div>\n\n\n\n<p>Our above code returns nothing because our user\u2019s age is 17. But if our user was under the age of 16, we would see this message: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>You are not old enough to use this service.<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">If Else Statement<\/h2>\n\n\n\n<p>With an if statement, we only execute code when our requirements are met. However, we may want something else to happen if our conditions are not met.<\/p>\n\n\n\n<p>For example, let\u2019s say that we want to present a user with a message if they missed filling out the address form field when they were making a purchase. We also want to present them with a message if the form was filled out correctly, so they know their purchase will go through.<\/p>\n\n\n\n<p>We can use the <code>if else<\/code> statement to implement this in our code. The <code>else<\/code> statement is written after the <code>if<\/code> statement and has no conditions. Here is the syntax for an else block: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if conditions_are_met\n\t\/\/ Run code\nelse\n\t\/\/ Run other code\nEnd<\/pre><\/div>\n\n\n\n<p>Let\u2019s use the same example as we used above to illustrate an <code>if statement<\/code>, and add in a message that appears if a user is 16 or older:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>user_age = 17\nif user_age &lt; 16\n\tputs \"You are not old enough to use this service.\"\nelse\n\tputs \"Your purchase is being processed.\"\nEnd<\/pre><\/div>\n\n\n\n<p>The above code first defines our user\u2019s age, which is 17 in this case. Then, it runs an <code>if<\/code> statement to evaluate whether the user age is less than 16 conditional is true. Since our user is over the age of 16, the program runs the <code>else<\/code> code. In this case, our code returns the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Your purchase is being processed.<\/pre><\/div>\n\n\n\n<p>We can take this one step further by using an <code>elsif<\/code> statement. This statement gives us the ability to check for another set of criteria if our first statement evaluates to false. For example, we may be operating a movie theater and offer different rates depending on the age of the customer.<\/p>\n\n\n\n<p>Here\u2019s an example of an <code>elsif<\/code> statement that checks a customer\u2019s age and returns the price they should pay for a ticket:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>customer_age = 17\nticket_price = 0\nif customer_age &lt;= 16\n\tticket_price = 10\nelsif customer_age &gt; 16 &amp;&amp; customer_age &lt; 65\n\tticket_price = 15\nelsif customer_age &gt; 65\n\tticket_price = 10\nend\nputs ticket_price<\/pre><\/div>\n\n\n\n<p>There is a lot going on here, so let\u2019s break it down. On the first lines, we define our customer\u2019s age as <code>17<\/code>, and the ticket price as <code>0<\/code>. Then, our program executes an if statement to check the age of the customer and set the ticket price accordingly.<\/p>\n\n\n\n<p>If our customer is 16 or under, they pay $10 for their ticket; if our customer is aged over 16 and under 65, they\u2019ll pay $15; if our customer is over the age of 65, they\u2019ll pay $10.<\/p>\n\n\n\n<p>In this case, our customer is 17, which means our code will return the following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>15<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Multiple Conditions<\/h2>\n\n\n\n<p>If you want to check if two things are true at the same time, you can use multiple conditions. In the above example, we illustrated how an <code>if<\/code> statement can be given multiple conditions by checking if a customer\u2019s age was between 16 and 65.<\/p>\n\n\n\n<p>In Ruby, we use the <code>&amp;&amp;<\/code> (<code>AND<\/code>) operator to separate the conditions we want to check are true. Here\u2019s an example of an if statement with multiple conditions:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if user_discount == true &amp;&amp; age &lt; 5\n\t\/\/ Run code\nEnd<\/pre><\/div>\n\n\n\n<p>We can use the <code>&amp;&amp;<\/code> operator as many times as we want to check if a certain statement evaluates to be true.<\/p>\n\n\n\n<p>On the other hand, if we want to check if either one of two or more statements are true, we can use the <code>||<\/code> (<code>OR<\/code>) operator. This operator would be useful if, for example, we want to run code if a user is either a <code>gold<\/code> or <code>platinum<\/code> customer. Here\u2019s an example of the <code>||<\/code> operator in action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>loyalty_plan = \"Gold\"\ndiscount = 0\nif loyalty_plan == \"Gold\" || loyalty_plan == \"Platinum\"\n\tdiscount = 10\nend\nprint discount<\/pre><\/div>\n\n\n\n<p>Because our user is on the <code>Gold<\/code> loyalty plan, our code returns the following: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>10<\/pre><\/div>\n\n\n\n<p>But if our user was not on the <code>Gold<\/code> or <code>Platinum<\/code> loyalty plan, our code would return <code>0<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ruby Conditions<\/h2>\n\n\n\n<p>In the if statement we defined earlier in the tutorial, we checked if a user\u2019s age was 16 or greater, but there are other symbols you can use in an if statement. We call these conditional statements or conditional operators.<\/p>\n\n\n\n<p>Here is a list of the conditions you can use in your if statements:<\/p>\n\n\n\n<figure class=\"wp-block-table course-info-table\"><table><tbody><tr><td>Symbol<\/td><td>Definition<\/td><\/tr><tr><td>&gt;<\/td><td>Greater than<\/td><\/tr><tr><td>&lt;<\/td><td>Less than<\/td><\/tr><tr><td>==<\/td><td>Equal to<\/td><\/tr><tr><td>!=<\/td><td>Not equal to<\/td><\/tr><tr><td>&gt;=<\/td><td>Greater than or equal to<\/td><\/tr><tr><td>&lt;=<\/td><td>Less than or equal to<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>If statements can be used in the Ruby programming language to evaluate whether a statement is true and run code if that statement is true. They can be useful if you have specific code that should only be run when a set of conditions are met. For example, you may want to allow a user to submit a form only if they are logged in.<\/p>\n\n\n\n<p>In this tutorial, we have discussed the basics of <code>if<\/code> statements in Ruby. We have also explored how you can use <code>else<\/code> and <code>elseif<\/code> to customize your if statements based on multiple possible outcomes.<\/p>\n\n\n\n<p>Now you\u2019re ready to use <code>if<\/code> statements like a Ruby expert!<\/p>\n\n\n\n<p><strong><em>Ruby is used by professional developers around the world for a variety of purposes. If you\u2019re curious about how learning Ruby can help you break into your dream career in tech, download the <\/em><\/strong><a href=\"https:\/\/careerkarma.com\/\"><strong><em>free Career Karma app<\/em><\/strong><\/a><strong><em> and talk with one of our coaches!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"When you\u2019re programming in Ruby, you may want to run certain code only if a condition is met. For example, you may want to stop a customer from buying a product if there is no stock left in inventory, or only allow a customer to proceed with a purchase if they have filled out all&hellip;","protected":false},"author":240,"featured_media":12491,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17278],"tags":[],"class_list":{"0":"post-12490","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-ruby"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Ruby","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","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>Ruby If Statement: A Complete Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"\u201cIf\u201d statements allow programmers to control the flow of their code. Learn more about how Ruby \u201cif\u201d and \u201cif else\u201d statements work in this Career Karma 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\/ruby-if-statement\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ruby If Statement\" \/>\n<meta property=\"og:description\" content=\"\u201cIf\u201d statements allow programmers to control the flow of their code. Learn more about how Ruby \u201cif\u201d and \u201cif else\u201d statements work in this Career Karma article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/\" \/>\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=\"2020-02-24T19:33:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T10:30:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\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\/ruby-if-statement\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Ruby If Statement\",\"datePublished\":\"2020-02-24T19:33:23+00:00\",\"dateModified\":\"2023-12-01T10:30:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/\"},\"wordCount\":1035,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg\",\"articleSection\":[\"Ruby\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/\",\"name\":\"Ruby If Statement: A Complete Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg\",\"datePublished\":\"2020-02-24T19:33:23+00:00\",\"dateModified\":\"2023-12-01T10:30:19+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"\u201cIf\u201d statements allow programmers to control the flow of their code. Learn more about how Ruby \u201cif\u201d and \u201cif else\u201d statements work in this Career Karma article.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby\",\"item\":\"https:\/\/careerkarma.com\/blog\/ruby\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Ruby If Statement\"}]},{\"@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":"Ruby If Statement: A Complete Guide | Career Karma","description":"\u201cIf\u201d statements allow programmers to control the flow of their code. Learn more about how Ruby \u201cif\u201d and \u201cif else\u201d statements work in this Career Karma 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\/ruby-if-statement\/","og_locale":"en_US","og_type":"article","og_title":"Ruby If Statement","og_description":"\u201cIf\u201d statements allow programmers to control the flow of their code. Learn more about how Ruby \u201cif\u201d and \u201cif else\u201d statements work in this Career Karma article.","og_url":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-02-24T19:33:23+00:00","article_modified_time":"2023-12-01T10:30:19+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.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\/ruby-if-statement\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Ruby If Statement","datePublished":"2020-02-24T19:33:23+00:00","dateModified":"2023-12-01T10:30:19+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/"},"wordCount":1035,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg","articleSection":["Ruby"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/","url":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/","name":"Ruby If Statement: A Complete Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg","datePublished":"2020-02-24T19:33:23+00:00","dateModified":"2023-12-01T10:30:19+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"\u201cIf\u201d statements allow programmers to control the flow of their code. Learn more about how Ruby \u201cif\u201d and \u201cif else\u201d statements work in this Career Karma article.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/ruby-if-statement\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/RUBY-IF-STATEMENT.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/ruby-if-statement\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ruby","item":"https:\/\/careerkarma.com\/blog\/ruby\/"},{"@type":"ListItem","position":3,"name":"Ruby If Statement"}]},{"@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\/12490","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=12490"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12490\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12491"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}