Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

.localeCompare number func

return [...this.posts].sort((post1, post2) => String(post1[this.selectedSort])?.localeCompare(String(post2[this.selectedSort])));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #number #func
ADD COMMENT
Topic
Name
7+3 =