}
function render(results) {
- for (var nodeID in results) {
- if (results.hasOwnProperty(nodeID) && $placeholdersToUpdate.hasOwnProperty(nodeID)) {
+ Object.keys(results || {}).forEach(function (nodeID) {
+ if ($placeholdersToUpdate.hasOwnProperty(nodeID)) {
$placeholdersToUpdate[nodeID].attr('href', results[nodeID].first_new_comment_link).text(Drupal.formatPlural(results[nodeID].new_comment_count, '1 new comment', '@count new comments')).removeClass('hidden');
show($placeholdersToUpdate[nodeID]);
}
- }
+ });
}
if (drupalSettings.comment && drupalSettings.comment.newCommentsLinks) {