{"id":12763,"date":"2020-06-25T15:40:29","date_gmt":"2020-06-25T22:40:29","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=12763"},"modified":"2023-12-01T03:34:38","modified_gmt":"2023-12-01T11:34:38","slug":"javascript-arrow-function","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/","title":{"rendered":"JavaScript Arrow Functions: A Step-By-Step Guide"},"content":{"rendered":"\n<p><em>JavaScript arrow functions are a way of declaring functions. Arrow functions can be used to write JavaScript functions more efficiently and using more concise syntax. Arrow function syntax supports implicit returns for single expressions.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>A function is a block of code that performs a specific action and\/or returns a value. Functions are used by programmers to create code that can be reused multiple times. This helps reduce the number of lines in a program, thereby making it more efficient.<\/p>\n\n\n\n<p>Traditionally, JavaScript offered one way to declare a function: using the <code>function<\/code> keyword. However, since ES6, JavaScript supports <code>arrow functions<\/code> which can be used to more efficiently define a function.<\/p>\n\n\n\n<p>In this guide, we are going to explore the basics of functions in JavaScript and discuss how the JavaScript arrow function can be used. We\u2019ll also discuss where you may want to use an arrow function, and explore a few examples to illustrate how arrow functions can be used in practice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Function Refresher<\/h2>\n\n\n\n<p>The most common method used to declare a function in JavaScript is by using the regular <code>function<\/code> keyword. The <code>function<\/code> keyword allows coders to declare a function that can be referenced throughout their code.<\/p>\n\n\n\n<p>Here\u2019s the syntax for a JavaScript function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>function nameOfTheFunction() {\n   \/\/ Code\n  }<\/pre><\/div>\n\n\n\n<p>Our function contains a number of parts. Firstly, we use the <code>function<\/code> keyword to tell our program that we are going to declare a function. Then, we specify the name of our function, which in the above example is <code>nameOfTheFunction<\/code>. It\u2019s important to note that function names use the same rules as variables, and so they are written in camel case.<\/p>\n\n\n\n<p>Our function then is followed by a set of brackets, which can optionally be used to parse parameters. Then, our code is contained within a set of curly brackets (<code>{}<\/code>).<\/p>\n\n\n\n<p>Let\u2019s use an example to illustrate how a function works in JavaScript. The following code creates a function called <code>wakeUpRoutine<\/code> which prints a morning message to the console:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>function wakeUpRoutine() {\n   console.log(\"Good morning! Today is a great day.\");\n  }\n<\/pre><\/div>\n\n\n\n<p>Right now, if we run our program, nothing will happen. This is because our function has been declared, but we have not yet called the function. If we want to run our function, we can call it by writing out the name of the function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>wakeUpRoutine();\n<\/pre><\/div>\n\n\n\n<p>Our program returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Good morning! Today is a great day.<\/pre><\/div>\n\n\n\n<p>We can use our function as many times as we want throughout our program by calling it where we want it to be executed.<\/p>\n\n\n\n<p>JavaScript functions can also take parameters. Parameters are input that are passed into a function and act as local variables within the function. So, let\u2019s say that we wanted our wake up message to include our name. We could use the following code to include our name in the wake up message:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>function wakeUpRoutine(name) {\n   console.log(`Good morning, ${name}! Today is a great day.`);\n}\n<\/pre><\/div>\n\n\n\n<p>In our code, we have not defined our <code>name<\/code> parameter. That\u2019s because we assign it a value when we call our function. Let\u2019s say that our name is <code>Peter<\/code>. In order to make our message appear with our name, we would use the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>wakeUpRoutine(\"Peter\");\n<\/pre><\/div>\n\n\n\n<p>Our program returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Good morning, Peter! Today is a great day.<\/pre><\/div>\n\n\n\n<p>The value of our <code>name<\/code> parameter is passed into the wakeUpRoutine function, which in this case is <code>Peter<\/code>. We then use the <code>name<\/code> variable in our function to reference the name our program has specified.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript Arrow Function<\/h2>\n\n\n\n<p>JavaScript arrow functions, sometimes referred to as <code>fat arrow<\/code> functions, are one of the most popular features introduced in ES6. These function expressions can be used to write functions more efficiently and using more concise syntax.<\/p>\n\n\n\n<p>The syntax for a JavaScript arrow function is as follows:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>functionName = (parameters) =&gt; {\n   \/\/ Code\n  }\n<\/pre><\/div>\n\n\n\n<p>Let\u2019s use the wake up routine example to illustrate how the JavaScript arrow functions. In our above code, we had to use the \u201cfunction\u201d keyword.\u201d However, with an arrow function, we use the <code>=&gt;<\/code> syntax instead. Here\u2019s an example of our wake up routine function written as an arrow function:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>wakeUpRoutine = (name) =&gt; {\n   console.log(`Good morning, ${name}! Today is a great day.`);\n  }\n<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>In order to call our function, we use the same syntax as we would with a traditional function:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>wakeUpRoutine(\"Sophia\")<\/pre><\/div>\n\n\n\n<p>Our function returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Good morning, Sophia! Today is a great day.<\/pre><\/div>\n\n\n\n<p>The structure for arrow functions is very similar to that of a traditional function. The only differences are that we don\u2019t use the <code>function<\/code> keyword in an arrow function, and instead we use a <code>=&gt;<\/code> arrow.<br><\/p>\n\n\n\n<p>In addition, notice that we did not need to use the <code>return<\/code> keyword in our arrow function, which makes our code even more concise.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implicit Returns<\/h2>\n\n\n\n<p>Arrow functions are particularly useful if the function body is a single expression. If the function body is a single expression, you can remove the curly brackets and create an implicit return to simplify your function. This is different from a traditional function where the number of lines used in your function did not affect how the function was defined.<br><\/p>\n\n\n\n<p>Here\u2019s an example of a one-line arrow function:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const multiplyNumbers = (a, b) =&gt; a * b;\nmultiplyNumbers(2, 2);\n<\/pre><\/div>\n\n\n\n<p>Our code returns: <code>4<\/code>. As you can see, our arrow function has multiplied our two numbers.<br><\/p>\n\n\n\n<p>The implicit return syntax is usually used if you are returning values, like we did above. However, you can also use the syntax to execute code that will not return any values. So, if you wanted to use implicit syntax to recreate our wake up routine function, you could use this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const wakeUpRoutine = name =&gt; console.log(`Good morning, ${name}! Today is a great day.`);\nwakeUpRoutine(\"Ava\");\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>Good morning, Ava! Today is a great day.<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Removing Parentheses<\/h2>\n\n\n\n<p>JavaScript arrow functions only need parenthesis around the parameters if there are no parameters or more than one. So, if your arrow function only has one parameter, you can remove the parentheses like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>wakeUpRoutine = name =&gt; {\n   console.log(`Good morning, ${name}! Today is a great day.`);\n}\n<\/pre><\/div>\n\n\n\n<p>As you can see, our <code>name<\/code> parameter is no longer surrounded by parentheses.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Arrow Functions with Map, Filter, and Reduce<\/h2>\n\n\n\n<p>Arrow functions are commonly used with the map, filter, and reduce JavaScript array methods, as arrow functions allow you to transform an array in only one line.<br><\/p>\n\n\n\n<p>Let\u2019s say that we have an array of student grades. We want to add <code>1<\/code> to each student grade because there was an error in a recent test that meant students could not answer a certain question, and so nobody could get a perfect score of <code>30<\/code>. Here\u2019s an example of an arrow function we could use to fix the test scores:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>const grades = [25, 26, 22, 28];\nconst fixStudentGrades = grades.map( score =&gt; score + 1 );\nconsole.log(fixStudentGrades);\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>[26, 27, 23, 29]<\/pre><\/div>\n\n\n\n<p>As you can see, our code has added <code>1<\/code> to each grade in our <code>grades<\/code> array.<\/p>\n\n\n\n<iframe loading=\"lazy\" frameborder=\"0\" width=\"100%\" height=\"400px\" src=\"https:\/\/repl.it\/@careerkarma\/JavaScript-Arrow-Functions?lite=true\"><\/iframe>\n<br>\n<br>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Arrow functions are a feature introduced in ES6 JavaScript that can be used to write more efficient and concise code. Arrow functions allow you to use the <code>=&gt;<\/code> arrow in place of a <code>function<\/code> statement, and also facilitate writing one-line functions in certain circumstances.<br><\/p>\n\n\n\n<p>In this tutorial, we explored the basics of how functions work in JavaScript, then we discussed how to write arrow functions. In addition, we also explored implicit returns, removing parentheses, and using arrow functions with the <code>map<\/code>, <code>filter<\/code>, and <code>reduce<\/code> functions.<br><\/p>\n\n\n\n<p>Now you\u2019re equipped with the knowledge you need to write an arrow function like an expert!<br><\/p>\n","protected":false},"excerpt":{"rendered":"JavaScript arrow functions are a way of declaring functions. Arrow functions can be used to write JavaScript functions more efficiently and using more concise syntax. Arrow function syntax supports implicit returns for single expressions. A function is a block of code that performs a specific action and\/or returns a value. Functions are used by programmers&hellip;","protected":false},"author":240,"featured_media":12766,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-12763","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 Arrow Functions: A Step-By-Step Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"JavaScript arrow functions are used to write more efficient functions. Learn how to use JavaScript arrow functions 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-arrow-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Arrow Functions: A Step-By-Step Guide\" \/>\n<meta property=\"og:description\" content=\"JavaScript arrow functions are used to write more efficient functions. Learn how to use JavaScript arrow functions on Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/\" \/>\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-25T22:40:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:34:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.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-arrow-function\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"JavaScript Arrow Functions: A Step-By-Step Guide\",\"datePublished\":\"2020-06-25T22:40:29+00:00\",\"dateModified\":\"2023-12-01T11:34:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/\"},\"wordCount\":1109,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/\",\"name\":\"JavaScript Arrow Functions: A Step-By-Step Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg\",\"datePublished\":\"2020-06-25T22:40:29+00:00\",\"dateModified\":\"2023-12-01T11:34:38+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"JavaScript arrow functions are used to write more efficient functions. Learn how to use JavaScript arrow functions on Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg\",\"width\":1000,\"height\":668},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#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 Arrow Functions: 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":"JavaScript Arrow Functions: A Step-By-Step Guide | Career Karma","description":"JavaScript arrow functions are used to write more efficient functions. Learn how to use JavaScript arrow functions 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-arrow-function\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Arrow Functions: A Step-By-Step Guide","og_description":"JavaScript arrow functions are used to write more efficient functions. Learn how to use JavaScript arrow functions on Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-06-25T22:40:29+00:00","article_modified_time":"2023-12-01T11:34:38+00:00","og_image":[{"width":1000,"height":668,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.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-arrow-function\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"JavaScript Arrow Functions: A Step-By-Step Guide","datePublished":"2020-06-25T22:40:29+00:00","dateModified":"2023-12-01T11:34:38+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/"},"wordCount":1109,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/","url":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/","name":"JavaScript Arrow Functions: A Step-By-Step Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg","datePublished":"2020-06-25T22:40:29+00:00","dateModified":"2023-12-01T11:34:38+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"JavaScript arrow functions are used to write more efficient functions. Learn how to use JavaScript arrow functions on Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/03\/woman-sitting-while-operating-macbook-pro-1181676.jpg","width":1000,"height":668},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/javascript-arrow-function\/#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 Arrow Functions: 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\/12763","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=12763"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/12763\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/12766"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=12763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=12763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=12763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}