title: Javascript array is not accessible as an array
body: <p>I'm working with the twitter API and I'm hitting a really confusing issue.</p>
  
  <p>I have the following script:</p>
  
  <pre><code>const Twitter = require('twitter-api-stream')
  const twitterCredentials = require('./credentials').twitter
  
  const twitterApi = new Twitter(twitterCredentials.consumerKey, twitterCredentials.consumerSecret, function(){
      console.log(arguments)
  })
  
  twitterApi.getUsersTweets('everycolorbot', 1, twitterCredentials.accessToken, twitterCredentials.accessTokenSecret, (error, result) =&gt; {
      if (error) {
          console.error(error)
      }
      if (result) {
          console.log(result) // outputs an array of json objects
          console.log(result.length) //outputs 3506 for some reason (it's only an array of 1)
          console.log(result[0]) // outputs a opening bracket ('[')
          console.log(result[0].text) // outputs undefined
      }
  })
  </code></pre>
  
  <p>Which is calling the following function to interact with twitter:</p>
  
  <pre><code>TwitterApi.prototype.getUsersTweets = function (screenName, statusCount, userAccessToken, userRefreshToken,cb ) {
      var count = statusCount || 10;
      var screenName = screenName || "";
  
      _oauth.get(
          "https://api.twitter.com/1.1/statuses/user_timeline.json?count=" + count + "&amp;screen_name=" + screenName
          , userAccessToken
          , userRefreshToken
          , cb
      );
  };
  </code></pre>
  
  <p>It <em>seems</em> like I'm getting the result I want. When I log the result itself I get the following output: </p>
  
  <pre><code>[
    {
      "created_at": "Thu Sep 01 13:31:23 +0000 2016",
      "id": 771339671632838656,
      "id_str": "771339671632838656",
      "text": "0xe07732",
      "truncated": false,
      ...
    }
  ]
  </code></pre>
  
  <p>Which is great, an array of the tweets limited to 1 tweet. </p>
  
  <p>The problem I'm running into is when I try to access this array. </p>
  
  <pre><code>console.log(result.length) //outputs 3506 for some reason (it's only an array of 1)
  console.log(result[0]) // outputs a opening bracket ('[')
  console.log(result[0].text) // outputs undefined
  </code></pre>
  
  <p>I read back through the <a href="https://dev.twitter.com/rest/reference/get/statuses/user_timeline" rel="noreferrer">api docs for the user_timeline</a> but unless I'm completely missing it I'm not seeing any mention of special output. </p>
  
  <p>Any ideas?</p>
  
  <h1>Update</h1>
  
  <p>Thanks @nicematt for pointing out that answer. </p>
  
  <p>Just to elaborate on the solution, I updated my code to this and now I'm getting the result I want:</p>
  
  <pre><code>if (result) {
      let tweet = JSON.parse(result)[0] // parses the json and returns the first index
      console.log(tweet.text) // outputs '0xe07732'
  }
  </code></pre>
  
  <p>Thanks for the help!</p>