How do i remove questionList[num] of questionList? In this way I'm getting the 1 Element I don't want to have anymore.
const [questionList, setQuestionList] = useState<{question: string, id: number}[]>([]);const getNumber = () => { const num = Math.floor(Math.random() * questionList.length); if (num) { const qid = questionList[num].id; setQuestionList(questionList.filter((obj) => obj.id !== qid)); setNumber(num); return qid; } };