Array with text returns true

I’m working in a little game and when accesing an array with text, it’s return me true. The array content is the same to its previous value and when I try to acces it it return the text

I can`t upload all the code but here is the array

export const universityEvents = [
  {
    id: 'universityEntry',
    position: 0, //to localice the event
    currentDialog: 0,
    content:[ 
      {
        currentPhrase: 0,
        content: [
          ['Jesús', `Even with the pandemic, the hard teachers,the incredible stress, the brutal anxiety`],
          ['Jesús',`The two hours in bus that took to get here, the high cost of the fees`],
          ['Jesús', `Some unpleasant colleagues, and the bureaucracy...`],
          ['Jesús', `My college years were some of the best of my life`],
        ],
      },
      {
        currentPhrase: 0,
        content: [
          ['Jesús', `But it's time to look forward, now I have two degrees and i have to get a job`]
        ]
      }
    ]
  }
]

And here the code in what I’m accesing (event data is a copy of universityEvents):

 //get content
    let numberofPhrase = eventData[dataPosition].content[currentDialog].currentPhrase
    actualPhrase = eventData[dataPosition].content[currentDialog].content[0]
    console.log(actualPhrase)

I tried to acces with [0], [1],[2] and in all the cases with 0 and 2 display the text but in one returns true. It’s something about the content that i dont know? why this happens

Edit: I’ve create a repository for the code, the array its in data/universityEvents, the scene with the code its scenes/university scene: GitHub repository

yep, current dialog its a global variable that updates in another method, I’m uploading the project to github, will edit when its done

SOLVED

after a lot of debugging I found that the error was in another method when in order to update the current phrase I used =! instead !=, a typing error that I don’t know why causes that true result but now its working. Close the post, lots of thanks!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.