Below is the interface I have designed:
export interface Post {
_id: string;
admin: Admin;
comments: PostComment[];
createdAt: Date;
modified: boolean;
text?: string;
desc?: string;
photoPath?: string;
}
However, when trying to use this code snippet:
const post = posts.find((e: Post) => e._id === cmnt.postId);
An error is thrown stating 'Property 'find' does not exist on type 'Post[]'. How can I resolve this issue?