title: Array after a function
body: <p>Hello im new in react sometimes i find there are array after a function, I tried to find the use of it, can explain the use of it or provide a link for the documentation for will be helpful. Thank you</p>
  <p>This is the example of the code</p>
  <pre><code>export const PostsList = () =&gt; {  
      const {
        data: posts = [],
        isLoading,
        isSuccess,
        isError,
        error
      } = useGetPostsQuery()
      
      const sortedPosts = useMemo(() =&gt; {
      const sortedPosts = posts.slice()
      sortedPosts.sort((a, b) =&gt; b.date.localeCompare(a.date))
  
      return sortedPosts
      
    }, [posts])}
  
  
  </code></pre>
  <p>I dont know the use of [posts] at the end of the code</p>