JSFiddle - React, Tailwind, and code Playground

JavaScript

var reviews=[]
reviews.push({ 'reviewer' : 'John', 
               'review' : 'This movie was the greatest', 
               'comments' : { 'commenter' : 'Dave',
                              'comment' : 'The review by John was too short'} 
             });


for(var i=0;i<reviews.length;i++){
    if(reviews[i]["reviewer"]=="John"){
       var count=Object.keys(reviews[i].comments).length/2;
       reviews[i].comments["commenter"+(count+1)]="another commenter";
       reviews[i].comments["comment"+(count+1)]="some other comment";
       console.log(count);
    }
}
    
   
console.log(reviews[0].comments);