I have an array A = [1,3] - which stores positions of correct answers from another array B = ["answer1","answer2","answer3","answer4"].
I need to get an array C which will be consist from the correct answers, something like this ["answer1","answer3"].
Example: If array A consist from 1 element (for example A = [2]), then array C should look like C = ["answer2"].
I can solve this problem with indexOf(), when I have an array A consisting from 1 element. But when there are 2 or more elements I'm getting stuck
for (var i in A) C += B[A[i]-1]Just to know.