Your two functions are identical.

const sum1 = function(list, prop){ return list.reduce( function(a, b){ return a + b[prop];}, 0);};

const sum2 = (list,prop) =>  { return list.reduce((a,b) => {return (a+ b[prop])}, 0)};

const list = [{foo:1},{foo:2},{foo:3}]

console.log(sum1(list, 'foo'));
console.log(sum2(list, 'foo'));
Answer from H.P. on Stack Overflow
🌐
Plain English
plainenglish.io › blog › how-to-convert-any-function-to-an-arrow-function-in-javascript-afb0c87e411d
How To Convert Any Function To An Arrow Function In JavaScript
December 1, 2012 - For the right side of the arrow: If the function only returns an expression, then you can remove the “return” keyword along with the curly braces around the function body. In this case, the result of the expression will be automatically returned. If the returned expression is too large to fit in a single line, you can use parentheses around it. This is especially more commonly used in React.js development. Following the steps above, you can fully convert your traditional function into an arrow function.
🌐
Team Treehouse
teamtreehouse.com › library › convert-to-arrow-function-expressions
Convert to Arrow Function Expressions (How To) | Practice Arrow Functions in JavaScript | Treehouse
Convert to Arrow Function Expressions. Turn regular function declarations into arrow function expressions.
Published   September 10, 2018
Discussions

Convert normal function to arrow function - javascript
I am trying to convert the below function into arrow function using ES6, $scope.sum = function(list, prop){ return list.reduce( function(a, b){ return a + b[prop]; }, 0); }; I tried below... More on stackoverflow.com
🌐 stackoverflow.com
Convert function expression to arrow function.
There was an error while loading. Please reload this page More on github.com
🌐 github.com
11
June 27, 2017
Converting ECMAScript 6's arrow function to a regular function
The issue is, I don't really understand how arrow functions work, and my IDE thinks it's bad syntax and refuses to check the rest of my document for syntax errors. How would I go about converting this to a regular function to alleviate both issues? More on stackoverflow.com
🌐 stackoverflow.com
How to convert a function to arrow function inside an object
Be aware that the context of this inside an arrow function is different. More info here: Methods in ES6 objects: using arrow functions ... If you just want a shorter syntax, there is one that happens to be the most appropriate syntax for this use case, aynway: method definitions. More on stackoverflow.com
🌐 stackoverflow.com
November 10, 2021
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Functions › Arrow_functions
Arrow function expressions - JavaScript - MDN Web Docs
February 21, 2026 - Arrow functions can be async by prefixing the expression with the async keyword. ... Let's decompose a traditional anonymous function down to the simplest arrow function step-by-step.
🌐
OneCompiler
onecompiler.com › javascript › 3x349sw5p
3x349sw5p - JavaScript - OneCompiler
Arrow Functions helps developers to write code in concise way, it’s introduced in ES6. Arrow functions can be written in multiple ways.
🌐
Charandev
charandev.com › convert-your-traditional-functions-into-arrow-functions-in-3-simple-steps
https://charandev.com/convert-your-traditional-fun...
Hey there 👋 I’m Sai Charan, a full-stack web developer👨‍💻, photographer📸 and technology enthusiast📱 who specializes in front-end development.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
One Liner Converter - Visual Studio Marketplace
March 23, 2019 - Visual Studio Code>Other>One Liner ConverterNew to Visual Studio Code?
Find elsewhere
🌐
W3Schools
w3schools.com › js › js_arrow_function.asp
JavaScript Arrow Functions
You can skip the function keyword, the return keyword, and the curly brackets: const multiply = (a, b) => a * b; Try it Yourself » · Arrow Functions were introduced in ES6 and are commonly used in modern JavaScript.
🌐
Medium
medium.com › @obiagba.mary.ifeoma › understanding-regular-function-converting-to-arrow-function-3121446a663
Understanding Regular Function & Converting To Arrow Function
August 6, 2020 - We just need to “call” the function whenever we need the code we “saved” inside it to be executed anywhere in our project or program. Regular function has been in use since the initial stage of javascript. Arrow function on the other hand was introduced in the ES6 version of javascript.
🌐
GitHub
github.com › cmstead › js-refactor › issues › 43
Convert function expression to arrow function. · Issue #43 · cmstead/js-refactor
June 27, 2017 - Convert function expression to arrow function.#43 · Copy link · Assignees · Labels · enhancement · ravshansbox · opened · on Jun 27, 2017 · Issue body actions · No description provided. 👍React with 👍1machineghost · cmstead · enhancement · No projects ·
Author   ravshansbox
🌐
Stack Overflow
stackoverflow.com › questions › 69909797 › how-to-convert-a-function-to-arrow-function-inside-an-object
How to convert a function to arrow function inside an object
November 10, 2021 - Another solution would be to call object.name and object.age within the printIt function of the first code example, but that's not best practice as the arrow function has to be changed when you rename the object.
🌐
JetBrains
jetbrains.com › guide › javascript › tips › create-arrow-function
Create Arrow Functions in One Click - JetBrains Guide
July 17, 2024 - Arrow functions? Yes, please! Press ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) to convert a function to an arrow function.
🌐
Darek Kay
darekkay.com › blog › webstorm-convert-to-arrow-function
Convert to arrow function in WebStorm - Darek Kay
June 19, 2019 - Configure an intention action using Structural Search and Replace to transform JavaScript functions into arrow functions.
🌐
Team Treehouse
teamtreehouse.com › community › convert-the-greet-function-declaration-to-an-arrow-function-hint-arrow-functions-are-not-hoisted-or-lifted-to-the
Convert the greet function declaration to an arrow function. HINT: Arrow functions are not hoisted – or lifted – to the (Example) | Treehouse Community
November 29, 2021 - And then you have to move where you calling the function below where you assign the function to a variable because you can't call it before it exists as a variable. So here is my code that will pass the challenge. const greet = (val) => { return `Hi, ${val}!`; } greet('cool coders'); If this does not make sense, I would recommend re-watching the 3 videos that come before the challenge. Happy coding! Front End Web Development Treehouse Moderator 25,178 Points ... And you actually can write the arrow function even more concisely.