Array assignments not being parsed correctly

I’ve hit an issue where I can no longer deploy my project successfully as array assignments are being incorrectly parsed from basic to javascript - and the [x].identifier is becoming [x] identifier. Here is a section from code.js:

        for (player in result_details.performance[team_keys[x]]) {
            if (player_keys[y] != undefined && player_keys[y] > 0) {
                if (result_details.teams[0] == team_keys[x]) {
                    fixture_perf[t1] = result_details.performance[team_keys[x]][player];
                    fixture_perf[t1] player_id = player_keys[y];
                    fixture_perf[t1] team_id = team_keys[x];
                    t1 = t1 + 1;

Yet in my code it is correct as follows:

    For Each player in result_details.performance[team_keys[x]]
      If player_keys[y] <> undefined And player_keys[y] > 0 Then
        If result_details.teams[0] = team_keys[x] Then
          fixture_perf[t1] = player
          fixture_perf[t1].player_id = player_keys[y]
          fixture_perf[t1].team_id = team_keys[x]
          t1 = t1 + 1

It’s completely baffled me. I’ve removed all my recent code changes but can’t prevent this problem from occurring - other than removing certain sections seems to move the problem further down the code. I’ve also edited code.js, replaced those spaces and run through javascript validators and it validates fine. So not sure what AppStudio is doing with putting in those spaces instead of ‘.’. Any ideas?

Hi Michael,
Have you made sure that all the closing „end if“ and „next“ statements match with the If and For Each statements? This looks a bit like an unbalanced conditional or loop statement issue.

Yep. Did check all of that. I’m not 100% sure how but after moving functions around etc I got it working again. My suspicion is that an API call returns data with an element named ‘number’. Therefore, my code will often have to use data[x].number - and before I hit the issue I was experiencing some issues with this being changed to data[x].Number as I typed - due to it being a reserved word. I can’t get round that but wonder if the reserve word checks should be relaxed when checking object names associated with arrays in this way?