{"id":12428,"date":"2020-12-07T15:42:30","date_gmt":"2020-12-07T23:42:30","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12428"},"modified":"2023-12-01T04:05:41","modified_gmt":"2023-12-01T12:05:41","slug":"javascript-sort-array","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/","title":{"rendered":"JavaScript Sort Array: A How-To Guide"},"content":{"rendered":"\n<p><em>You can use the JavaScript sort() method to sort an array. The sort() method accepts an array as an argument and sorts its values in ascending order. Arrays are sorted in place which means the original array is modified. A new array is not created.<\/em><\/p>\n\n\n\n<p>You may decide that you want to sort your array in a particular order. For instance, you may have a list of names that you want to display to the user in alphabetical order.\n\n<\/p>\n\n\n\n<p>Depending on how you want to sort the elements in an array, there are built-in JavaScript functions that can help. For example, you can use the sort() function to sort an array in alphabetical order, the reverse() function to sort an array in reverse order, and the sort() function with a nested function to create your own custom sorts.\n\n<\/p>\n\n\n\n<p>In this tutorial, we are going to break down how to use sort() and reverse() to perform a sort array function in JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript sort() Method<\/h2>\n\n\n\n<p>The JavaScript sort() method reads the values in an array and returns those values in either ascending or descending order. A string containing either numbers or strings can be sorted.<\/p>\n\n\n\n<p>Consider the following syntax:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const values = [1, 2, 8, 9, 3];\nvalues.sort();<\/pre><\/div>\n\n\n\n<p>This code sorts our &#8220;values&#8221; list. The list is sorted in place which means our original list is modified. sort() does not create a new version of a list.<\/p>\n\n\n\n<p>It\u2019s worth noting that the sort() method modifies the original array and changes its order. If we want to keep our original array the same, we can run the sort() function and store its value in a new variable.<\/p>\n\n\n\n<p>If you assign the contents of the sort() method to a new variable, the original list will still be changed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">JavaScript Sort Array Example<\/h3>\n\n\n\n<p>To sort an array in JavaScript, we use the built-in default sort() method. In its most simple form, the sort() method sorts an array in ascending alphabetical order. Here\u2019s an example of the sort() method in action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var students = ['Alex', 'Cathy', 'Lincoln', 'Jeff'];\nvar sorted_students = students.sort();\n\nconsole.log(sorted_students);\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>[&quot;Alex&quot;, &quot;Cathy&quot;, &quot;Jeff&quot;, &quot;Lincoln&quot;]<\/pre><\/div>\n\n\n\n<p>Our array has been sorted in ascending order. We use the sort() method to sort our <a href=\"https:\/\/careerkarma.com\/blog\/javascript-variables\/\">JavaScript variable<\/a> called &#8220;students&#8221;. Then, we print the value of &#8220;students&#8221; to the <a href=\"https:\/\/careerkarma.com\/blog\/javascript-console\/\">JavaScript console<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Array sort(): Order a Numeric Array<\/h2>\n\n\n\n<p>We can use the sort() method to sort the values in a numerical list in ascending order.<\/p>\n\n\n\n<p>Say we have a list of student grades that we want to sort in ascending order. We could sort them using the sort() method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var grades = [67, 75, 62, 78];\ngrades.sort();\n\nconsole.log(grades);\n<\/pre><\/div>\n\n\n\n<p>The output from our code is as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[62, 67, 75, 78]<\/pre><\/div>\n\n\n\n<p>Our array has been sorted in ascending order! When our program starts the sort() operation, the elements within our array are sorted based on their values\/.<\/p>\n\n\n\n<p>Because sort() sorts a list in place, we do not need to assign the result of sort() to a new variable. Our code prints out the newly-sorted &#8220;grades&#8221; array to the console.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Sort Array of Objects<\/h2>\n\n\n\n<p>The sort() method can be used to sort an array of objects. For example, we may have an array of JSON objects that store both a student\u2019s name and age.\n\n<\/p>\n\n\n\n<p>Here\u2019s an example of a sort() function that would sort such an array by the ages of our students:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var students = [\n\t{ name: &quot;Alex&quot;, age: 16 },\n{ name: &quot;Cathy&quot;, age: 14 },\n{ name: &quot;Lincoln&quot;, age: 14 },\n{ name: &quot;Jeff&quot;, age: 15 }\n];\n\nvar sorted_students = students.sort(function(a, b) {\n\treturn a.age - b.age;\n});\n\nconsole.log(sorted_students);\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>[\n  { &quot;name&quot;: &quot;Cathy&quot;, &quot;age&quot;: 14},\n  { &quot;name&quot;: &quot;Lincoln&quot;, &quot;age&quot;: 14},\n  { &quot;name&quot;: &quot;Jeff&quot;, &quot;age&quot;: 15},\n  { &quot;name&quot;: &quot;Alex&quot;, &quot;age&quot;: 16}\n]<\/pre><\/div>\n\n\n\n<p>Our code returned our array of JSON objects in order of student ages.\n\n<\/p>\n\n\n\n<p>On the first line, we declare our \u201cstudents\u201d variable with four students. We then create a function that sorts our students variable based on the \u201cage\u201d value in each <a href=\"https:\/\/careerkarma.com\/blog\/javascript-objects\/\">JSON object<\/a> by comparing ages. Finally, our program prints out our sorted list of students.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Array sort(): Sort in Reverse Order<\/h2>\n\n\n\n<p>There is also a built-in JavaScript function that allows you to sort an array in reverse order: reverse().<\/p>\n\n\n\n<p>The reverse() method reverses an array so that the first element becomes the last, and the last element becomes the first. Thus, this array does not order an array in alphabetical descending order.<\/p>\n\n\n\n<p>If we sort a list first using the sort() method, we can use reverse() to see our array in descending order.<\/p>\n\n\n\n<p>Here\u2019s an example of the reverse() function in action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var students = ['Alex', 'Cathy', 'Lincoln', 'Jeff'];\nvar reversed_students = students.reverse();\n\nconsole.log(reversed_students);\n<\/pre><\/div>\n\n\n\n<p>Our code returns the following:\n\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[\u201cJeff\u201d, \u201cLincoln\u201d, \u201cCathy\u201d, \u201cAlex\u201d]<\/pre><\/div>\n\n\n\n<p>We first sort our list in ascending order using sort(). Then, we reverse the list using reverse(). Our list now shows our names in descending order alphametically.<\/p>\n\n\n\n<p>The reverse() function, like the sort() function, modifies the order of our list. We cannot assign the result of reverse() to a new variable without modifying the original array. We talked about this earlier with the sort() method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The JavaScript sort() method orders the contents of a list in either ascending or descending order. sort() modifies a list in place which means the method does not create a new list. reverse(), when used after sort(), sorts a list in descending order.<\/p>\n\n\n\n<p>In this tutorial, we have broken down how to sort an array in JavaScript using sort(). We discussed sorting a numerical array, how to sort an array of objects, and using reverse() to reverse the contents of an array.<\/p>\n\n\n\n<p>For advice on top JavaScript learning resources and online courses, check out our <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-javascript\/\">How to Learn JavaScript article<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"You can use the JavaScript sort() method to sort an array. The sort() method accepts an array as an argument and sorts its values in ascending order. Arrays are sorted in place which means the original array is modified. A new array is not created. You may decide that you want to sort your array&hellip;","protected":false},"author":240,"featured_media":12432,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-12428","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 Sort Array: A How-To Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"The sort() and reverse() functions can be used to sort a JavaScript array. Learn more about how these functions work, and how you can use them to sort an array on Career Karma.\" \/>\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-sort-array\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Sort Array: A How-To Guide\" \/>\n<meta property=\"og:description\" content=\"The sort() and reverse() functions can be used to sort a JavaScript array. Learn more about how these functions work, and how you can use them to sort an array on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/\" \/>\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-12-07T23:42:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:05:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"668\" \/>\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-sort-array\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Sort Array: A How-To Guide\",\"datePublished\":\"2020-12-07T23:42:30+00:00\",\"dateModified\":\"2023-12-01T12:05:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/\"},\"wordCount\":863,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/\",\"name\":\"JavaScript Sort Array: A How-To Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg\",\"datePublished\":\"2020-12-07T23:42:30+00:00\",\"dateModified\":\"2023-12-01T12:05:41+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The sort() and reverse() functions can be used to sort a JavaScript array. Learn more about how these functions work, and how you can use them to sort an array on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg\",\"width\":1000,\"height\":668},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#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 Sort Array: 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 Sort Array: A How-To Guide | Career Karma","description":"The sort() and reverse() functions can be used to sort a JavaScript array. Learn more about how these functions work, and how you can use them to sort an array on Career Karma.","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-sort-array\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Sort Array: A How-To Guide","og_description":"The sort() and reverse() functions can be used to sort a JavaScript array. Learn more about how these functions work, and how you can use them to sort an array on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-12-07T23:42:30+00:00","article_modified_time":"2023-12-01T12:05:41+00:00","og_image":[{"width":1000,"height":668,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.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-sort-array\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Sort Array: A How-To Guide","datePublished":"2020-12-07T23:42:30+00:00","dateModified":"2023-12-01T12:05:41+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/"},"wordCount":863,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/","url":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/","name":"JavaScript Sort Array: A How-To Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg","datePublished":"2020-12-07T23:42:30+00:00","dateModified":"2023-12-01T12:05:41+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The sort() and reverse() functions can be used to sort a JavaScript array. Learn more about how these functions work, and how you can use them to sort an array on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-sort-array\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/adult-african-american-woman-business-city-1181341.jpg","width":1000,"height":668},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-sort-array\/#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 Sort Array: 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\/12428","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=12428"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12428\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12432"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}