I have made a questionnaire using ionic slides and I am able to create an array called Answers which stores the selected value from each question.
I wanted to enquire how I can now use an if-statement with this array and then navigate to a specific page when I click "Finish" on the last question?
const answers = [selected1, selected2, selected3, selected4, selected5];
const s1 = [1,2,1,1,1];
function suggestion(answers: number[] | undefined): void {
if (answers == s1) {
**not sure what to do here to navigate**
}
}
This is the IonButton code:
<IonButton class = "finishbttn" size="small" onClick = {()=> suggestion(answers)}> Finish </IonButton>