Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140705

How do i write a higher order function ( map ) without the arrow function?

$
0
0

I am still new to react and ES6. I have been sitting with ES6 before learning react, but sometimes i just forget how to use ES5. I might be confused.

import React from 'react'
import './App.css'
import Joke from './component/Joke.js';
import JokesData from "./component/JokesData.js"

function App() {
//Mapping component. Getting data from another file. 
const jokeComponents = JokesData.map(function(item) {

<Joke key={justdo.id} question={justdo.question} puncline={justdo.punchline}/>)

  return (

    <div>{jokeComponents} </div>
  )
} 
}


export default App;

Viewing all articles
Browse latest Browse all 140705

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>