Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react conditional arrow map array

function App(){
    const items = useFetch()
    return (
        <div>
            {items.map( (item) => {
                if (item[1]==='something'){
                    return (
                        <li>{item[2]}</li>
                    )
                }
            })}
        </div>
    )
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #conditional #arrow #map #array
ADD COMMENT
Topic
Name
2+2 =