You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instead of indexOf() !== -1, includes is more semantic - docs
I would separate out the search term into a variable, so it reads more like asset.name.includes(searchTerm)
The search term could be simplified, after you note that this.state.search.length !== 0 could be replaced by this.state.search, since it's a string (and "" is falsey).
The text was updated successfully, but these errors were encountered:
mattlub
changed the title
readability of asset filter function
readability/improvements to asset filter function
Feb 11, 2018
To improve slightly here
3 things:
indexOf() !== -1
,includes
is more semantic - docsasset.name.includes(searchTerm)
this.state.search.length !== 0
could be replaced bythis.state.search
, since it's a string (and""
is falsey).The text was updated successfully, but these errors were encountered: