You can test if the key exists like this:
// by using the 'in' operator
content = ('retweeted_status' in tweets[i]) ? tweets[i]["retweeted_status"] : tweets[i]["text"];
// or by using the method 'hasOwnProperty()'
if(tweets[i].hasOwnProperty('retweeted_status')) {
content = tweets[i]["retweeted_status"];
} else {
content = tweets[i]["text"];
}
You could also checking for undefined, but this is not an accurate way of testing whether a key exists (What if the key exists but the value is actually undefined?).