I am creating a pagination component in which it shows movies on each page so my pagination function is totally fine and it returns the array of the movies that each page should return but when i call that function in movies and store it in a constant then it would give me undefined why is that can anybody help me?