Q:

Looping through user info in Parse Cloud Code

I'm just getting familiar with Parse's cloud code, but am having some trouble with a basic task: looping through one of array fields (called "newsFeed") for the logged in user.  Here's what I've got:
The Parse Code:
Parse. Cloud.define("unseenItems", function(request, response) {

  // Get list of all news items for current user
  var user = Parse.User.current();
  var newsFeed = user.get("newsFeed");

  // Loop through news items and count number of unseen items
  // ("unseen" is a key for the array object, the value is 0 or 1)
  var sum = 0;
  for (var i = 0; i < newsFeed.length; i++) {
    sum += newsFeed[i].get("unseen"); 
  }
  console.log(sum);

  // Return sum of unseen items
  response.success(sum);

});

The data structure
newsFeed is an array of dictionaries, here's a sample:
[{"date":<date info>,
  "text":"Sample text",
  "seen":0},
  {"date":<date info>,
  "text":"More sample text",
  "seen":1}]

The Objective-C code
[PFCloud callFunctionInBackground:@"unseenItems"
                   withParameters:@{}
                            block:^(NSNumber *result, NSError *error) {
                                if (! error){
                                    self.unseenItems=[result intValue];
                                }
                            }];

And here's the error I'm getting in XCode: Error: TypeError: Object #<Object> has no method 'get' at main.js:84:24 (Code: 141, Version: 1.5.0)
Any pointers on where to go from here would be fantastic.  Thanks for reading! 

A:

OK, the error was just in basic JavaScript usage.  To get inside the dictionary that's inside the array, here's what worked:
 for (var i = 0; i < newsFeed.length; i++) {
    sum += newsFeed[i]["unseen"]; 
  }

