title: angularjs: Push is not a function
body: <p>I have a JSON object like this:</p>
  
  <pre><code>var post = {
      "post_id": "1",
      "content": "content",
      "post_author": {
          "id": "12",
          "firstName": "Amelia",
          "lastName": "Earheart",
      },
      "isLiked": false,
      "likes_count": 0,
      "likers": [],
      "comments_count": 0,
      "commenters": [],
      "comments": []
  };
  </code></pre>
  
  <p>And <code>post</code> is passed to the function given below from the front end. </p>
  
  <pre><code>var vm = this;
  vm.likePost = function(post) {
      var likedPost = post;
      vm.userInfo();
      likedPost.likers.push(userObject); //Here
  
      myService.postLike(likedPost).success(function(data) {
          likedPost.isLiked = true;
          likedPost.likes_count++;
          vm.posts = data;
      });
  };
  </code></pre>
  
  <p>But doing so, I get a JavaScript error saying <code>push is not a function</code> in line <code>likedPost.likers.push(userObject);</code></p>
  
  <p>And <code>userObject</code> is returned by <code>vm.userInfo()</code> and it looks like this:</p>
  
  <pre><code>vm.userInfo = function() {
      myService.getBasicUserInfo().success(function(data) {
          vm.currentPost.post_author.id = data.id;
          vm.currentPost.post_author.firstName = data.firstName;
          vm.currentPost.post_author.lastName = data.lastName;
      });
  };
  </code></pre>
  
  <p>and the returned JSON is like this:</p>
  
  <pre><code>{"id":"12","firstName":"Amelia","lastName":"Earheart"}
  </code></pre>
  
  <p>Can anyone help me figure out the cause of this issue?</p>
  
  <p>UPDATE:</p>
  
  <pre><code>{
      "post_id": "12",
      "content": "Content is the content that contains the content",
      "image": "member-default.jpg",
      "created_at": "2016-05-26 14:29:00",
      "post_author": {
          "id": "12",
          "firstName": "Amelia",
          "lastName": "Earheart",
      },
      "isLiked": false,
  }
  </code></pre>
  
  <p>This is what I get upon <code>console.log(likedPost);</code></p>