DEV Community


Discussion on: The 7 JavaScript Skills You Need For React (+ Practical Examples)

belinde profile image
Franco Traversaro

Small suggestion: in the reduce() example you could skip the subsequent map() moving the jsx inside the reduce:

import React from "react";

function App() {
  const programmers = ["Reed", "John", "Jane"];

  return (
      {/* Returns 'Reed' */}
        (acc, programmer) => programmer.startsWith("J") 
            ? acc
            : acc.concat(<li>{programmer}</li>), 

export default App;
Enter fullscreen mode Exit fullscreen mode