I have an array questions [] with the following properties:
perguntas[0] = { id:1; ordem: 3; inicio: 1 };
perguntas[1] = { id:2; ordem: 2; inicio: 0 };
perguntas[2] = { id:3; ordem: 1; inicio: 1 };
I would like to change them to order in the array according to the start property. Where 1 should come first than 0.
I already use a function to sort according to the order property, but this sort would be secondary, giving priority to items with the start property set to 1.
How can I do this?
The expected result would be:
perguntas[0] = { id:3; ordem: 1; inicio: 1 };
perguntas[1] = { id:1; ordem: 3; inicio: 1 };
perguntas[2] = { id:2; ordem: 2; inicio: 0 };