{"id":13213,"date":"2020-06-24T21:20:42","date_gmt":"2020-06-25T04:20:42","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=13213"},"modified":"2023-12-01T03:23:20","modified_gmt":"2023-12-01T11:23:20","slug":"javascript-startswith-endswith","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/","title":{"rendered":"JavaScript startsWith and endsWith: A Complete Guide"},"content":{"rendered":"\n<p><em>The JavaScript <code>startsWith<\/code> method will return true or false if a string starts with a specified character or string. JavaScript <code>endsWith<\/code> works the same way but applies to the end of a string. Both accept parameters that effect where the methods search.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>In JavaScript, you may want to determine whether a string starts with or ends with a particular character or set of characters. For instance, if you\u2019re operating a cafe and want to find out whether key lime pie is the most popular flavor, you would want to check if your list of pie flavors ordered by popularity starts with key lime pie.<\/p>\n\n\n\n<p>The JavaScript <code>startsWith()<\/code> method is used to determine whether a string starts with a particular substring. The <code>endsWith()<\/code> method is used for the same purpose but checks whether a string ends with a specified substring.<\/p>\n\n\n\n<p>This tutorial will discuss how to use the <code>startsWith()<\/code> and <code>endsWith()<\/code> methods, and walk through an example of each of these functions step-by-step. By the end of this tutorial, you\u2019ll be an expert at using the <code>startsWith()<\/code> and <code>endsWith()<\/code> methods.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript startsWith<\/h2>\n\n\n\n<p>The <code>startsWith()<\/code> method determines whether a string begins with the characters of a specified substring, and returns true or false. The syntax for the <code>startsWith()<\/code> method is as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>string_name.startsWith(substring, position);<\/pre><\/div>\n\n\n\n<p>The <code>startsWith()<\/code> method accepts two parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>substring<\/strong> is the characters to be searched for at the start of the string object. (required)<\/li>\n\n\n\n<li><strong>position<\/strong> is the position at which the search should begin. (optional)<\/li>\n<\/ul>\n\n\n\n<p><code>startsWith()<\/code> returns a Boolean value\u2014true or false\u2014depending on whether the string starts with the substring you have specified.<\/p>\n\n\n\n<p>Let\u2019s go through an example to explain how the <code>startsWith<\/code> method works.<\/p>\n\n\n\n<p>Suppose you are operating a cafe and you want to determine whether key lime was the most popular pie sold in your store last month. You remember that a lot of key lime pies were ordered, and if it turns out to be the most popular flavor, you may want to run a new promotion on the pies to attract customers.<\/p>\n\n\n\n<p>You could use the <code>startsWith()<\/code> method to check whether key lime was the most popular pie ordered at your store. Here\u2019s an example of a program that accomplishes this task:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var pie_rankings = \"Key Lime Apple Blueberry Cherry Strawberry Pecan Peach\";\nconsole.log(pie_rankings.startsWith(\"Key Lime\"));<\/pre><\/div>\n\n\n\n<p>When we run our code, the following response is returned: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>true<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down our code. On the first line, we declare a string called <code>pie_rankings<\/code> which stores all the pies we sold last month. The first pie in our list is the most popular, the second pie is the second-most popular, and so on. Then, we use the <code>startsWith()<\/code> method to check if the string begins with <code>Key Lime<\/code>, and we use <code>console.log()<\/code> to print out the response to the console.<\/p>\n\n\n\n<p>In this case, our <code>pie_rankings<\/code> string starts with <code>Key Lime<\/code>, and so our program returned true.<\/p>\n\n\n\n<p>Now, suppose that we want to figure out whether apple pie was the second-most popular pie ordered last month. We recall that a lot of apple pies were ordered, and if apple was the second-most popular flavor, that next month we could raise the prices slightly.<\/p>\n\n\n\n<p>We could use the <code>startsWith()<\/code> method and its optional <code>position<\/code> parameter to determine whether apple pie was the second most popular pie ordered at our cafe.<\/p>\n\n\n\n<p>Now, in order for our program to work, we need to know the index value at which <code>Key Lime <\/code> ends (notice there is a space after <code>Key Lime<\/code>, because it is one entry of many in our list of pies). In this case, <code>Key Lime<\/code> lasts 9 characters\u2014seven are letters and two are spaces.<\/p>\n\n\n\n<p>So, we know that our search should start at index position 8 in our list. Here\u2019s an example of a program that allows us to check whether our list starts with <code>Apple<\/code> at the index position 9 (which is where the second pie starts in our list):<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var pie_rankings = \"Key Lime Apple Blueberry Cherry Strawberry Pecan Peach\";\nconsole.log(pie_rankings.startsWith(\"Apple\", 9));<\/pre><\/div>\n\n\n\n<p>Our code returns: true. <code>Apple<\/code> starts at the index position 9 in our list, so our code returned true. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript endsWith<\/h2>\n\n\n\n<p><code>endsWith()<\/code> is the opposite of the <code>startsWith()<\/code> method. The <code>endsWith()<\/code> method determines if a string ends with a particular set of characters. Here\u2019s the syntax for the <code>endsWith()<\/code> method:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>string_name.endsWith(substring, length);<\/pre><\/div>\n\n\n\n<p>The <code>endsWith()<\/code> method accepts two parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>substring<\/strong> is the string to search for in the string. (required)<\/li>\n\n\n\n<li><strong>length<\/strong> is the length of the string to search. The default value for this parameter is the length of the string. (optional)<\/li>\n<\/ul>\n\n\n\n<p>Let\u2019s explore an example of the <code>endsWith()<\/code> method.<\/p>\n\n\n\n<p>Suppose that we are looking to reduce the size of our menu by one pie because the baker who makes the pies is overwhelmed by the number of different pies they have to make. We think that peach pies were the least popular last month, and we want to check that against our list of pies ordered by popularity.<\/p>\n\n\n\n<p>We could use the following code to check if our list of pies ends with <code>Peach<\/code>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var pie_rankings = \"Key Lime Apple Blueberry Cherry Strawberry Pecan Peach\";\nconsole.log(pie_rankings.endsWith(\"Peach\"));<\/pre><\/div>\n\n\n\n<p>Our code returns: true. As you can see, our <code>pie_rankings<\/code> string ends with <code>Peach<\/code>. So, the <code>endsWith()<\/code> method returns <code>true<\/code>.<\/p>\n\n\n\n<p>In addition, we can specify the <code>length<\/code> argument if we want our string to stop searching at a certain index value. For instance, say we wanted to check whether <code>Strawberry<\/code> was the second-least popular pie sold last month.<\/p>\n\n\n\n<p>We know that the length of our string is 54, and if we subtract the length of <code>Peach<\/code> from the string, we can get the length of our string minus the last pie. <code>Peach<\/code> is 5 characters long, and if we subtract 5 from 54 we get 49.<\/p>\n\n\n\n<p>In addition, there is a space before <code>Peach<\/code> in our string, so we\u2019ll have to subtract another 1 from our string\u2019s length, which means the position at which the second last pie ends in the string is 48.<\/p>\n\n\n\n<p>Here\u2019s the code we could use to check whether <code>Strawberry<\/code> is the second-least popular pie in the <code>pie_rankings<\/code> string:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>var pie_rankings = \"Key Lime Apple Blueberry Cherry Strawberry Pecan Peach\";\nconsole.log(pie_rankings.endsWith(\"Strawberry\", 48));<\/pre><\/div>\n\n\n\n<p>Our code returns: false. As you can see, <code>Pecan<\/code> comes at the end of our list before the value <code>Peach<\/code> and <code>Strawberry<\/code> appears before <code>Pecan<\/code> in the list. As a result &#8212; <code>Strawberry<\/code> is not the second-last pie on the list &#8212; our code returns <code>false<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The <code>startsWith()<\/code> method is used to determine whether a string starts with a particular sequence of characters. The <code>endsWith()<\/code> method is used to check whether a string starts with a sequence of characters.<\/p>\n\n\n\n<p>This tutorial explored how to use the <code>startsWith()<\/code> and <code>endsWith()<\/code> methods in JavaScript, and walked through an example of each of the methods in action. You\u2019re now equipped with the knowledge you need to use the <code>startsWith()<\/code> and <code>endsWith()<\/code> methods like an expert.<\/p>\n","protected":false},"excerpt":{"rendered":"The JavaScript startsWith method will return true or false if a string starts with a specified character or string. JavaScript endsWith works the same way but applies to the end of a string. Both accept parameters that effect where the methods search. In JavaScript, you may want to determine whether a string starts with or&hellip;","protected":false},"author":240,"featured_media":13214,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-13213","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":"","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 startsWith and endsWith: A Complete Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"We use JavaScript startsWith and endsWith methods to check if a string starts with or ends with a substring. Learn more in this article.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript startsWith and endsWith: A Complete Guide\" \/>\n<meta property=\"og:description\" content=\"We use JavaScript startsWith and endsWith methods to check if a string starts with or ends with a substring. Learn more in this article.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/\" \/>\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-06-25T04:20:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:23:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\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-startswith-endswith\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript startsWith and endsWith: A Complete Guide\",\"datePublished\":\"2020-06-25T04:20:42+00:00\",\"dateModified\":\"2023-12-01T11:23:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/\"},\"wordCount\":1041,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/\",\"name\":\"JavaScript startsWith and endsWith: A Complete Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg\",\"datePublished\":\"2020-06-25T04:20:42+00:00\",\"dateModified\":\"2023-12-01T11:23:20+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"We use JavaScript startsWith and endsWith methods to check if a string starts with or ends with a substring. Learn more in this article.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg\",\"width\":1020,\"height\":680,\"caption\":\"JavaScript startsWith and endsWith\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#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 startsWith and endsWith: 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 startsWith and endsWith: A Complete Guide | Career Karma","description":"We use JavaScript startsWith and endsWith methods to check if a string starts with or ends with a substring. Learn more in this article.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript startsWith and endsWith: A Complete Guide","og_description":"We use JavaScript startsWith and endsWith methods to check if a string starts with or ends with a substring. Learn more in this article.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-06-25T04:20:42+00:00","article_modified_time":"2023-12-01T11:23:20+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.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-startswith-endswith\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript startsWith and endsWith: A Complete Guide","datePublished":"2020-06-25T04:20:42+00:00","dateModified":"2023-12-01T11:23:20+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/"},"wordCount":1041,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/","url":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/","name":"JavaScript startsWith and endsWith: A Complete Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg","datePublished":"2020-06-25T04:20:42+00:00","dateModified":"2023-12-01T11:23:20+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"We use JavaScript startsWith and endsWith methods to check if a string starts with or ends with a substring. Learn more in this article.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/photo-of-men-doing-fist-bump-3184302.jpg","width":1020,"height":680,"caption":"JavaScript startsWith and endsWith"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-startswith-endswith\/#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 startsWith and endsWith: 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\/13213","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=13213"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/13213\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/13214"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=13213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=13213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=13213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}