{"id":12581,"date":"2020-08-07T19:53:24","date_gmt":"2020-08-08T02:53:24","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12581"},"modified":"2023-12-01T03:57:23","modified_gmt":"2023-12-01T11:57:23","slug":"javascript-random-number","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/","title":{"rendered":"JavaScript Random Number: A Complete Guide"},"content":{"rendered":"\n<p><em>To create a random number in Javascript, the <code>math.random()<\/code> function is used. JavaScript <code>math.random()<\/code> generates a random decimal value between 0 and 1. The function does not take any arguments. To get random numbers higher than 1 simply multiply the result according to the need. <\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>In programming, there are often instances where you need to retrieve a random number. For example, you may be creating a guessing game and want your program to generate a random number every time the user runs your program. Or you may want to run a function a random number of times.<br><\/p>\n\n\n\n<p>That\u2019s where the JavaScript Math.random() function comes in. Math.random() is a built-in method that can be used to generate random numbers in JavaScript. The function returns a value between 0 (inclusive) and 1 (exclusive), but we can use another function called Math.floor() to turn our number into a whole random number.<br><\/p>\n\n\n\n<p>In this tutorial, we are going to explore the basics of JavaScript random number generation, and discuss how you can use the Math.random() function in your code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Math Refresher<\/h2>\n\n\n\n<p>The JavaScript Math object offers developers a number of mathematical functions which can be performed on numbers. These functions include returning the absolute value of a number, rounding a number, calculating the square root of a number, among others.<br><\/p>\n\n\n\n<p>The Math object works with the Number data type in JavaScript. Here\u2019s what the Math object looks like in a JavaScript program:<br><\/p>\n\n\n\n<p><code>Math.functionName();<br><\/code><\/p>\n\n\n\n<p>One of the most useful functions in the Math library &#8212; and one that we will use later in this tutorial &#8212; is the Math.floor() function. This method can be used to deliver a value rounded downwards to the closest integer, or whole number. Here\u2019s an example of the Math.floor() method in action:<br><\/p>\n\n\n\n<p><code>console.log(Math.floor(5.7));<br><\/code><\/p>\n\n\n\n<p>Our code returns: 5. The number the Math.floor() function processed was rounded down, which is why our program returned \u201c5\u201d instead of \u201c6.\u201d<br><\/p>\n\n\n\n<p>Similarly, the Math.round() function can be used to round a number up to the nearest value. Here\u2019s an example of the Math.round() function in action:<br><\/p>\n\n\n\n<p><code>console.log(Math.round(5.7));<br><\/code><\/p>\n\n\n\n<p>Our code returns: <code>6. <\/code>The Math object includes a number of other mathematical functions that can be used to work with numbers, but the main ones you need to know about to generate a JavaScript random number are Math.floor() and Math.random().<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Math.random()<\/h2>\n\n\n\n<p>The JavaScript Math.random() method returns a random number between 0 (inclusive) and 1 (exclusive). The Math.random() function returns a floating point pseudo-random number, which means it will include a decimal. The syntax for the Math.random() method is as follows:<br><\/p>\n\n\n\n<p><code>Math.random();<br><\/code><\/p>\n\n\n\n<p>Here\u2019s an example of console.log() being used to print out a random number:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>console.log(Math.random());\n<\/pre><\/div>\n\n\n\n<p>Our program returns:<br><\/p>\n\n\n\n<p><code>0.022831222528214346<br><\/code><\/p>\n\n\n\n<p>As you can see, our program has returned a random number between zero and one. But this number is rather small, and many applications that need random numbers want to generate larger numbers. That\u2019s where the Math.floor() function comes in.<br><\/p>\n\n\n\n<p>We can use the Math.floor() function to round our random number up to become a random integer, and we can multiply that number to generate a larger one. Here\u2019s an example of a random number generator function in JavaScript:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var random_number = Math.floor(Math.random() * 10);\nconsole.log(random_number);\n<\/pre><\/div>\n\n\n\n<p>Here\u2019s the result of our program after running it three times:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>5\n5\n1\n<\/pre><\/div>\n\n\n\n<p>As you can see, our program has generated a random number. In the above example, we used <code>\u201c* 10\u201d <\/code>to generate a larger number. That function helps us retrieve a number between <code>\u201c1\u201d<\/code> and <code>\u201c10.\u201d<\/code> If we wanted a larger number, we could change our multiple like so:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var random_number = Math.floor(Math.random() * 100);\nconsole.log(random_number);\n<\/pre><\/div>\n\n\n\n<p>After running our program three times, the following numbers were generated:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>44\n7\n26<\/pre><\/div>\n\n\n\n<p>So, let\u2019s say that we are creating an addition game and we want to generate two random numbers between \u201c1\u201d and \u201c100\u201d for our addition sum to include. We could use the following code to generate our random numbers:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var number_one = Math.floor(Math.random() * 100);\nvar number_two = Math.floor(Math.random() * 100);\nconsole.log(`What is ${number_one} + ${number_two}?`);<\/pre><\/div>\n\n\n\n<p>Our program returns:<br><\/p>\n\n\n\n<p><code>What is 93 + 56?<br><\/code><\/p>\n\n\n\n<p>In the above example, we first generated two random numbers using the Math.random() function. Then, we printed out a statement that asks the user <code>\u201cWhat is [our first number] + [our second number]?\u201d<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Random Number Between Two Values<\/h2>\n\n\n\n<p>Math.random() does not include any arguments, which means we cannot use the function to generate a number between two values. However, we can create a custom method that allows us to generate a random number between two values.<br><\/p>\n\n\n\n<p>Let\u2019s say that we are creating an addition game that should generate two numbers between 100 and 200 for a more advanced level.<br><\/p>\n\n\n\n<p>Here\u2019s an example function that we could use to generate those numbers:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const generateRandomNumber = (min, max) =&gt;  {\nreturn Math.floor(Math.random() * (max - min) + min);\n  };\nconsole.log(generateRandomNumber(100, 200));<\/pre><\/div>\n\n\n\n<p>When we run our program three times, the following values are returned:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>152\n186\n158<\/pre><\/div>\n\n\n\n<p>As you can see, our program generates random numbers within the range of 100 and 200. Let\u2019s break down our program and explore how it works in more depth.<br><\/p>\n\n\n\n<p>On the first line, we define a function called <code>\u201cgenerateRandomNumber().\u201d <\/code>Our function takes in two arguments: the minimum value and the maximum value of the range of numbers within which our random number should be generated. On the next line, we use the Math.random() function to generate a random number, and our <code>\u201cmax\u201d<\/code> and <code>\u201cmin\u201d <\/code>variables to ensure the number we generate will be in our range.<br><\/p>\n\n\n\n<p>Then, on the final line, we call our generateRandomNumber() function and pass it the values 100 and 200. So, when we run our program, a random number between 100 and 200 is generated.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The Math.random() JavaScript function can be used to generate random numbers between 0 (inclusive) and 1 (exclusive). Then, by using the Math.floor() function, we can generate larger numbers based on our needs.<br><\/p>\n\n\n\n<p>In this tutorial, we explored the basics of the JavaScript Math library and discussed how to use the Math.random() method to generate a random number. We also created a custom function that can be used to generate a random number between two values.<br><\/p>\n\n\n\n<p>Now you have the knowledge you need to generate your own random numbers in JavaScript like an expert!<br><\/p>\n","protected":false},"excerpt":{"rendered":"To create a random number in Javascript, the math.random() function is used. JavaScript math.random() generates a random decimal value between 0 and 1. The function does not take any arguments. To get random numbers higher than 1 simply multiply the result according to the need. In programming, there are often instances where you need to&hellip;","protected":false},"author":240,"featured_media":11165,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-12581","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 Random Number | Career Karma<\/title>\n<meta name=\"description\" content=\"Generating a random number is common in programming. Learn how to generate a random number in JavaScript using the Math.random() method 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-random-number\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Random Number: A Complete Guide\" \/>\n<meta property=\"og:description\" content=\"Generating a random number is common in programming. Learn how to generate a random number in JavaScript using the Math.random() method on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/\" \/>\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-08-08T02:53:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:57:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.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\/javascript-random-number\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Random Number: A Complete Guide\",\"datePublished\":\"2020-08-08T02:53:24+00:00\",\"dateModified\":\"2023-12-01T11:57:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/\"},\"wordCount\":977,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/\",\"name\":\"JavaScript Random Number | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg\",\"datePublished\":\"2020-08-08T02:53:24+00:00\",\"dateModified\":\"2023-12-01T11:57:23+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Generating a random number is common in programming. Learn how to generate a random number in JavaScript using the Math.random() method on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#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 Random Number: A Complete 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 Random Number | Career Karma","description":"Generating a random number is common in programming. Learn how to generate a random number in JavaScript using the Math.random() method 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-random-number\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Random Number: A Complete Guide","og_description":"Generating a random number is common in programming. Learn how to generate a random number in JavaScript using the Math.random() method on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-08-08T02:53:24+00:00","article_modified_time":"2023-12-01T11:57:23+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.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-random-number\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Random Number: A Complete Guide","datePublished":"2020-08-08T02:53:24+00:00","dateModified":"2023-12-01T11:57:23+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/"},"wordCount":977,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-random-number\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/","url":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/","name":"JavaScript Random Number | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg","datePublished":"2020-08-08T02:53:24+00:00","dateModified":"2023-12-01T11:57:23+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Generating a random number is common in programming. Learn how to generate a random number in JavaScript using the Math.random() method on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-random-number\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/gray-laptop-computer-showing-html-codes-in-shallow-focus-160107.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-random-number\/#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 Random Number: A Complete 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\/12581","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=12581"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12581\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/11165"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}