When you open a block {}
in an arrow function, the return
isn’t implied anymore.
You have to write it down :
this.state.articles.filter((article) => {
return article.category === filter
})
More Related Contents:
- Double digit 30 seconds countdown
- Difference between .ajaxSubmit() vs .submit()
- How do comparison operator in JavaScript work? Comparing string to string, string to number
- Using HTML5/Canvas/JavaScript to take in-browser screenshots
- Check if a user has scrolled to the bottom (not just the window, but any element) [duplicate]
- AngularJS : Initialize service with asynchronous data
- Most efficient way to create a zero filled JavaScript array?
- How to list subcollections in a Cloud Firestore document
- Get data from fs.readFile
- How to convert date to timestamp?
- Connecting to TCP Socket from browser using javascript
- How do I programatically select an HTML option using JavaScript?
- Get event listeners attached to node using addEventListener
- How to embed an autoplaying YouTube video in an iframe?
- Loading local files with Javascript without a web server
- How to use jQuery and jQuery plugins with PrimeFaces
- ngOnInit not being called when Injectable class is Instantiated
- Set cursor to specific position in CKEditor
- Mechanize and Javascript
- Browser back button handling
- Calling onclick on a radiobutton list using javascript
- How does Javascript know what type a variable is?
- React 18 strict mode causing component to render twice [duplicate]
- How do I create an abstract base class in JavaScript?
- How to use Javascript to check and load CSS if not loaded?
- Drawing arrows on an HTML page to visualize semantic links between textual spans
- Detecting user inactivity over a browser – purely through javascript [duplicate]
- Are 301 redirects possible using javascript or jQuery?
- Is triggering event listeners using “.click()” asynchronous?
- ES6 arrow function and lexical scope inside a function [duplicate]