"use strict";

class TopicReplyCounter {
  constructor(topicId, replies) {
    this.topicId = topicId;
    this.replies = replies;
    this.replyCount = this.replies.length;
  }
  
  addReply(reply) {
    
  }
  
  totalReplies() {
    return this.replies.filter(reply => !reply.isAbuse);
  }
  
  totalCount() {
    return this.replyCount;
  }
}
"use strict";

class TopicReplyCounter {
  constructor(topicId, replies) {
    this.topicId = topicId;
    this.replies = replies || [];
    this.replyCount = this.replies.length;
  }
  
  addReply(reply) {
    this.replies.push(reply);
    this.replyCount = this.totalReplies().length;
  }
  
  totalReplies() {
    return this.replies.filter(reply => !reply.isAbuse);
  }
  
  totalCount() {
    return this.replyCount;
  }
}
Add default value for this.replies. Complete addReply
Add default value for this.replies. Complete addReply
