title: can access a specific position of an array but can't access specific object inside of this array
body: <p>I'm having an issue that as the title say for itself.. </p>
  
  <p>I can access a specific position of an array but can't access specific object inside of this array..</p>
  
  <pre><code>export const getAccessLevel = id =&gt;{      
  
      const accessLevels = [
          {id: 0, name: 'Admin'},
          {id: 1, name: 'Customer'},
          {id: 2, name: 'Client'},
          {id: 3, name: 'Viewer'}
      ]
  
      let index = accessLevels.findIndex(array =&gt; array.id === id);
      console.log(index) // result : 3
  
  
      console.log(accessLevels[index]) 
      // this is returning {id: 3, name: "Viewer"}
  
      let AccessLevelName = accessLevels[index].name
      // this is return error : Cannot read property 'name' of undefined
  
      return AccessLevelName
  }
  </code></pre>