I have an array array like this
[
[
"text1",
"text2",
"text3",
"text4",
"text5"
],
[
"Rtext1",
"Rtext2",
"Rtext3",
"Rtext4",
"Rtext5"
],
[
"1",
"2",
"3",
"4",
"5"
]
]
I need to convert it in to the following format using JavaScript
[
[
"text1",
"Rtext1",
"1"
],
[
"text2",
"Rtext2",
"2"
],
[
"text3",
"Rtext3",
"3"
],
[
"text4",
"Rtext4",
"4"
],
[
"text5",
"Rtext5",
"5"
]
]
What is the best way to accomplish this using JavaScript or jQuery?
I used multiple for loops to loop through the array but couldn't get the hang of it.