Local variable not being recognized inside for loop – Javascript

I’m trying to reference a variable inside this for loop, but its not working. It recognizes the first variable in the line but anything beyond that it won’t recognize

        var farmsArray = Object.keys(farmsPath);
        var farmsList = new MessageEmbed()
            .setTitle("Available Farms")
            .setDescription("Where would you like to plant?")

        for(i=0; farmsArray[i] != undefined; i++){
            farmsList.addField(` ${farmsPath.farmsArray[i].name}`, farmsPath.farmsArray[i].size);
                 it recognizes this^          ^ but not this

Can someone help me find out why? I’ve been trying for a while now and I can’t seem to figure out the issue.

134 thoughts on “Local variable not being recognized inside for loop – Javascript”

  1. Pingback: cialis canada
  2. Pingback: viagra buy ireland
  3. Pingback: cialis tablet