Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sort array of objects

 {datacategorie?.sort((a,b)=> a.titreScategorie?.toLowerCase() > b.titreScategorie?.toLowerCase() ? 1 : -1)?.map((item) => (
                  <option key={item.id} value={item.id}>
                    {item.titreScategorie}
                  </option>
                ))}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #sort #array #objects
ADD COMMENT
Topic
Name
5+1 =