{"id":10226,"date":"2021-01-17T18:59:35","date_gmt":"2021-01-18T02:59:35","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=10226"},"modified":"2023-12-01T04:08:09","modified_gmt":"2023-12-01T12:08:09","slug":"how-to-use-ternary-operators-javascript","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/","title":{"rendered":"JavaScript Ternary Operators: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>The JavaScript ternary operator evaluates a statement and returns one of two values. A ternary operator can be instructed to return a value if the statement evaluates to either true or false. The syntax for the ternary operator is: statement ? if_true : if_false;.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>There may be times when you only want certain code to run when certain conditions are met.<\/p>\n\n\n\n<p>For example, let\u2019s say you have a date of birth field on your e-commerce website. Let&#8217;s also say you only allow customers over the age of 18 to purchase goods on your website. You\u2019ll want to check that a user is of the right age before they use their site.<\/p>\n\n\n\n<p>The potential outcome is true or false, so we can use a ternary operator to check if a user is the right age.<\/p>\n\n\n\n<p>In this tutorial, we\u2019re going to discuss how to use ternary operators. We&#8217;ll refer to an example to help you get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is a JavaScript Ternary Operator?<\/strong><\/h2>\n\n\n\n<p>JavaScript ternary operators, known as conditional ternary operators, are similar to <a href=\"https:\/\/careerkarma.com\/blog\/javascript-if-else\/\">JavaScript if&#8230;else statements<\/a>. A ternary operator checks if a condition is met, and do something depending on whether that condition is or is not met. <\/p>\n\n\n\n<p>The ternary expression has the following syntax: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>(condition) ? if true, then run : if false, then run<\/pre><\/div>\n\n\n\n<p>A condition comes first, then a question mark. The first expression will execute if the condition is met. The second condition second one will execute if the condition is not met. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Back to the Basics: if Statements<\/strong><\/h2>\n\n\n\n<p>The most basic JavaScript conditional operator is an \u201cif\u201d statement. This statement allows executes a block of code is a condition is met. Otherwise, the program executes the contents of an optional &#8220;else&#8221; statement.<\/p>\n\n\n\n<p>Here is an example of an if statement. We use the scenario of an e-commerce site that verifies the age of its users that we discussed earlier.\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\/\/ Declare our customer object\nlet customer = {\n\tname: &quot;Joe&quot;,\n\tage: 15\n}\n\nif (customer.age &gt;= 18) {\n\tuser_is_right_age = true;\n} else {\n\tuser_is_right_age = false;\n}\n<\/pre><\/div>\n\n\n\n<p>Our if statement will run, and <em>user_is_right_age<\/em> will be set to <em>false<\/em>. The program first checks if the customer\u2019s age is 18 or above. Because the user is not over 18, the else clause executes, and sets <em>user_is_right_age<\/em> to <em>false<\/em>.\n\n<\/p>\n\n\n\n<p>Although this code works, it is a lot of code! It takes us five lines to verify the age of our customer.\n\n<\/p>\n\n\n\n<p>What if I told you there was a way to perform this same function in only one line of code? That\u2019s where the ternary operator comes in.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Ternary Operator Examples<\/h2>\n\n\n\n<p>We can simplify our previous if statement by using a ternary operator:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>user_is_right_age = customer.age &gt;= 18 ? true : false;<\/pre><\/div>\n\n\n\n<p>This code, when executed, gives us the same result as our above code (<em>false<\/em>), but in fewer lines. If the conditional were true\u2014if the user\u2019s age was 18 or above\u2014then our program would return <em>true<\/em>.<\/p>\n\n\n\n<p>In the example we used above, our program checks whether the user is the right age. Our code returns <em>false<\/em> because the user is under 18\u2014our condition was not met.\n\n<\/p>\n\n\n\n<p>Let&#8217;s move on to another example. Say we want to check whether a customer on our site is eligible for express delivery. We could do this with a JavaScript ternary operator:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let userIsExpressCustomer = true;\n\nlet shippingTimeForCustomer = userIsExpressCustomer ? 48 : 72;<\/pre><\/div>\n\n\n\n<p>Our ternary operator will check if the user is an express customer, then it will determine the shipping time for the user. As seen above, our user is an express customer, so the condition evaluates to true, they get 48-hour delivery. If our customer was not an express customer, our code would evaluate to false. Thus, the customer would receive 72-hour delivery. \n\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Nested JavaScript Ternary Operators<\/strong><\/h2>\n\n\n\n<p>A nested JavaScript ternary operator is a ternary within another ternary. These statements are useful if you want to evaluate multiple operations. But, they can quickly become difficult to read if you are not careful.<\/p>\n\n\n\n<p>Let\u2019s say we are an e-commerce company that offers three delivery times: standard (72), express (48 hours); and one-day (24 hours). How do we use a ternary operator in this case, given there are three options? Should we just use an <em>if&#8230;else<\/em> statement instead?\n\n<\/p>\n\n\n\n<p>Don\u2019t worry, you can also use a JS ternary operator with three expressions. Here\u2019s an example of the above example in action:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>let userIsExpressCustomer = false;\nlet userIs24HourCustomer = true;\n\nlet shippingTimeForCustomer = userIsExpressCustomer ? 48 : userIs24HourCustomer ? 24 : 72;<\/pre><\/div>\n\n\n\n<p>In this case, the shipping time for our customer would be 24 hours. This program first checks if the user is an express customer, which they are not. Then, it checks if they are a 24-hour customer, which is true. So, the <em>shippingTimeForCustomer<\/em> variable is assigned the value 24.\n\n<\/p>\n\n\n\n<p>If the user was not an express or 24-hour customer, their delivery time would be 72 hours.\n\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>The JavaScript ternary operator is an alternative to the if statement when you want to evaluate whether a condition is true or false. You can enclose multiple ternary operators within another operator.<\/p>\n\n\n\n<p>Conditional statements like the ternary operator run certain code only when specific conditions are met. They are one of the key components of almost every programming language and will come up in almost every JavaScript program you write.<\/p>\n\n\n\n<p>Are you interested in learning more about JavaScript? We&#8217;ve got you covered. We have a complete guide on <a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-javascript\/\"><\/a><a href=\"https:\/\/careerkarma.com\/blog\/how-to-learn-javascript\/\">how to learn JavaScript<\/a>. In this guide, you&#8217;ll find all the resources you will need to further advance your knowledge of JavaScript.<\/p>\n","protected":false},"excerpt":{"rendered":"The JavaScript ternary operator evaluates a statement and returns one of two values. A ternary operator can be instructed to return a value if the statement evaluates to either true or false. The syntax for the ternary operator is: statement ? if_true : if_false;. There may be times when you only want certain code to&hellip;","protected":false},"author":240,"featured_media":12328,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[12687],"class_list":{"0":"post-10226","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript","8":"tag-tutorial"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"JavaScript","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use Ternary Operators in JavaScript | Career Karma<\/title>\n<meta name=\"description\" content=\"Ternary operators are a more efficient form of conditional statements in JavaScript. Learn how ternary operators work and how to use them.\" \/>\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\/how-to-use-ternary-operators-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Ternary Operators: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"Ternary operators are a more efficient form of conditional statements in JavaScript. Learn how ternary operators work and how to use them.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/\" \/>\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-18T02:59:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:08:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Ternary Operators: A Step-By-Step Guide\",\"datePublished\":\"2021-01-18T02:59:35+00:00\",\"dateModified\":\"2023-12-01T12:08:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/\"},\"wordCount\":868,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg\",\"keywords\":[\"tutorial\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/\",\"name\":\"How to Use Ternary Operators in JavaScript | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg\",\"datePublished\":\"2021-01-18T02:59:35+00:00\",\"dateModified\":\"2023-12-01T12:08:09+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Ternary operators are a more efficient form of conditional statements in JavaScript. Learn how ternary operators work and how to use them.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg\",\"width\":1200,\"height\":675,\"caption\":\"JavaScript Ternary Operators\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#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 Ternary Operators: A Step-By-Step Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use Ternary Operators in JavaScript | Career Karma","description":"Ternary operators are a more efficient form of conditional statements in JavaScript. Learn how ternary operators work and how to use them.","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\/how-to-use-ternary-operators-javascript\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Ternary Operators: A Step-By-Step Guide","og_description":"Ternary operators are a more efficient form of conditional statements in JavaScript. Learn how ternary operators work and how to use them.","og_url":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-01-18T02:59:35+00:00","article_modified_time":"2023-12-01T12:08:09+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.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\/how-to-use-ternary-operators-javascript\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Ternary Operators: A Step-By-Step Guide","datePublished":"2021-01-18T02:59:35+00:00","dateModified":"2023-12-01T12:08:09+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/"},"wordCount":868,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg","keywords":["tutorial"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/","url":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/","name":"How to Use Ternary Operators in JavaScript | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg","datePublished":"2021-01-18T02:59:35+00:00","dateModified":"2023-12-01T12:08:09+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Ternary operators are a more efficient form of conditional statements in JavaScript. Learn how ternary operators work and how to use them.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/javascript-ternary-operators.jpg","width":1200,"height":675,"caption":"JavaScript Ternary Operators"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/how-to-use-ternary-operators-javascript\/#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 Ternary Operators: A Step-By-Step Guide"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/10226","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=10226"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/10226\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12328"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=10226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=10226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=10226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}