{"id":20214,"date":"2021-01-17T00:34:34","date_gmt":"2021-01-17T08:34:34","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=20214"},"modified":"2023-12-01T04:08:07","modified_gmt":"2023-12-01T12:08:07","slug":"javascript-modulo","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/","title":{"rendered":"JavaScript Modulo: A How-To Guide"},"content":{"rendered":"\n<p><em>The JavaScript modulo operator returns the remainder of a division sum. To calculate the remainder of a division sum, use the percentage sign (%). The syntax for the modulo operator is: (number_one % number_two).<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use the JavaScript Modulo Operator<\/h2>\n\n\n\n<p>Have you ever seen a percentage sign accompanied by a few numbers in JavaScript? You\u2019ve maybe thought that it is something to do with calculating percentages. That\u2019s not the case. In JavaScript, the percentage sign is used to calculate remainders.\n\n<\/p>\n\n\n\n<p>The percentage sign (%) is the modulo operator. It divides two numbers and calculates the remainder left over, if any. It\u2019s commonly used to find out if a number is odd or even.\n\n<\/p>\n\n\n\n<p>In this guide, we\u2019re going to discuss how to use the JavaScript modulo operator. We\u2019ll walk through an example of this operator in action to help you get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the JavaScript Modulo Operator?<\/h2>\n\n\n\n<p>The JavaScript modulo operator, represented by a percentage sign, returns the remainder of a division sum. You can refer to the modulo operator by this name, as a modulus operator, or as a remainder operator.<\/p>\n\n\n\n<p>Not all numbers can be evenly divided. 9 cannot be divided by 4 without yielding a decimal number. If you\u2019re looking for precision, a decimal number is fine. There are some cases where you\u2019ll want to know how many numbers are left over from a calculation.<\/p>\n\n\n\n<p>The modulo operator tells you what is left over when a number has been divided as many times as it can be. The remainder of 9 divided by 4 is 1. 4 goes into 9 twice. There is 1 left over.<\/p>\n\n\n\n<p>The syntax for the modulo operator is:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>console.log(9 \/ 4);<\/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>1<\/pre><\/div>\n\n\n\n<p>You can use the modulo operator in JavaScript with negative values:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>console.log(-9 \/ 4);<\/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>-2.25<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Modulo Operator JavaScript Example<\/h2>\n\n\n\n<p>We want to create a tool that tells a young person how much will be left over if they spend money on video games. We\u2019ll start building our program by declaring two <a href=\"https:\/\/careerkarma.com\/blog\/javascript-variables\/\">JavaScript variables<\/a>:\n\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var game_cost = 40;\nvar balance = 122;<\/pre><\/div>\n\n\n\n<p>The first variable stores the cost of a game. Our second variable stores how much money we have in our bank account. Let\u2019s use the modulo operator to find out how much we would have left over if we spent all our money on games:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>console.log(balance % game_cost);<\/pre><\/div>\n\n\n\n<p>Our code returns: 2. This tells us that if we spend all of our money on video games, we will have $2 left over.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Using the Division Operator<\/h3>\n\n\n\n<p>The modulo operator tells you how much is left over by dividing two numbers. This does not tell us how many games we can buy. We can use the <a href=\"https:\/\/careerkarma.com\/blog\/javascript-math\/\">JavaScript division operator<\/a> to calculate how many games we can buy.\n\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>console.log(Math.round((balance \/ game_cost), 0));<\/pre><\/div>\n\n\n\n<p>In this code, we use the division operator (\/) to calculate how many games we can buy. We have then rounded this value to the nearest whole value. This is because you cannot buy a portion of a game; you have to buy a whole game.<\/p>\n\n\n\n<p>Our code returns: 3. <\/p>\n\n\n\n<p>These two operations combined tell us that we can afford three video games. We will have $2 left over after we have bought these games.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Check if a Number is Odd or Even<\/h2>\n\n\n\n<p>The modulo operator is used to check if a number is odd or even. This is because even numbers have no remainders when divided by two. Odd numbers, on the other hand, have a remainder if they are divided by two.<\/p>\n\n\n\n<p>We\u2019re going to build an application that tells us whether we can purchase an even or odd number of candy bars. This program assumes we have a certain amount of money. Let\u2019s start by declaring variables which track the cost of a candy bar and how much money we have:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var cost = 1.50;\nvar balance = 3.50;<\/pre><\/div>\n\n\n\n<p>We\u2019ll then use the division operator to find out how many we can buy: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var can_buy = Math.round((balance \/ cost), 0);\nconsole.log(can_buy);<\/pre><\/div>\n\n\n\n<p>This code returns: 2. This tells us we can afford to purchase two full candy bars. The <a href=\"https:\/\/careerkarma.com\/blog\/javascript-round\/\">JavaScript Math.round() method<\/a> rounds the value returned by our division sum to the nearest decimal place. This is useful because we cannot buy part of a candy bar.<\/p>\n\n\n\n<p>Next, we can use the modulo operator to check if the number of candy bars we can buy is odd or even:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>if (can_buy % 2 != 0) {\n\tconsole.log(&quot;You can buy an even number of candy bars.&quot;);\n} else {\n\tconsole.log(&quot;You can buy an odd number of candy bars.&quot;);\n}<\/pre><\/div>\n\n\n\n<p>Our code uses the modulo operator to check if there is any remainder left over after dividing the number by two. If there is, the number is odd; otherwise, the number is even.<\/p>\n\n\n\n<p>Our code uses the modulo operator to check if there is any remainder left over after dividing the number by two. We use a JavaScript if statement to specify what should happen if there is a remainder. If there is, the number is odd; otherwise, the number is even.<\/p>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>You can buy an even number of candy bars.<\/pre><\/div>\n\n\n\n<p>The value of \u201ccan_buy\u201d is 2. This is an even number so the code inside our <em>if<\/em> statement runs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The JavaScript modulo operator calculates the remainder left over after dividing two numbers. It is commonly used with an <em>if<\/em> statement to evaluate whether a number is odd or even. The modulo operator is represented by a percentage sign.<\/p>\n\n\n\n<p>Do you want to learn more about how to code in JavaScript? Read our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-javascript\/\">How to Learn JavaScript guide<\/a>. You&#8217;ll find top tips on how to learn JavaScript and a list of learning resources you can leverage.<\/p>\n\n\n\n<p>Our code returns: You can buy an even number of candy bars. The value of \u201ccan_buy\u201d is 2. This is an even number so the code inside our <code>if<\/code> statement runs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The modulo operator calculates the remainder left over after dividing two numbers. It is commonly used with an <code>if<\/code> statement to evaluate whether a number is odd or even.<br><\/p>\n\n\n\n<p>Now you\u2019re ready to start using the JavaScript modulo operator like an expert!<\/p>\n","protected":false},"excerpt":{"rendered":"The JavaScript modulo operator returns the remainder of a division sum. To calculate the remainder of a division sum, use the percentage sign (%). The syntax for the modulo operator is: (number_one % number_two). How to Use the JavaScript Modulo Operator Have you ever seen a percentage sign accompanied by a few numbers in JavaScript?&hellip;","protected":false},"author":240,"featured_media":20215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-20214","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript"},"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 Modulo: A How-To Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"The modulo operator calculates the remainder of a division sum. On Career Karma, learn how to use the JavaScript modulo operator.\" \/>\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-modulo\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Modulo: A How-To Guide\" \/>\n<meta property=\"og:description\" content=\"The modulo operator calculates the remainder of a division sum. On Career Karma, learn how to use the JavaScript modulo operator.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/\" \/>\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-01-17T08:34:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:08:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"681\" \/>\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-modulo\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Modulo: A How-To Guide\",\"datePublished\":\"2021-01-17T08:34:34+00:00\",\"dateModified\":\"2023-12-01T12:08:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/\"},\"wordCount\":960,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/\",\"name\":\"JavaScript Modulo: A How-To Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg\",\"datePublished\":\"2021-01-17T08:34:34+00:00\",\"dateModified\":\"2023-12-01T12:08:07+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The modulo operator calculates the remainder of a division sum. On Career Karma, learn how to use the JavaScript modulo operator.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg\",\"width\":1020,\"height\":681},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#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 Modulo: A How-To 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 Modulo: A How-To Guide | Career Karma","description":"The modulo operator calculates the remainder of a division sum. On Career Karma, learn how to use the JavaScript modulo operator.","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-modulo\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Modulo: A How-To Guide","og_description":"The modulo operator calculates the remainder of a division sum. On Career Karma, learn how to use the JavaScript modulo operator.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-01-17T08:34:34+00:00","article_modified_time":"2023-12-01T12:08:07+00:00","og_image":[{"width":1020,"height":681,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.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-modulo\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Modulo: A How-To Guide","datePublished":"2021-01-17T08:34:34+00:00","dateModified":"2023-12-01T12:08:07+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/"},"wordCount":960,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-modulo\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/","url":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/","name":"JavaScript Modulo: A How-To Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg","datePublished":"2021-01-17T08:34:34+00:00","dateModified":"2023-12-01T12:08:07+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The modulo operator calculates the remainder of a division sum. On Career Karma, learn how to use the JavaScript modulo operator.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-modulo\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/07\/christina-wocintechchat-com-CmvA0xCDfC8-unsplash.jpg","width":1020,"height":681},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-modulo\/#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 Modulo: A How-To 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\/20214","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=20214"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/20214\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/20215"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=20214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=20214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=20214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}