title: How to find object length in vue
body: <p>I am trying to write a form validation using VueJS. </p>
  
  <p>I keep testing for the length of the error object. I keep getting undefined when I log it console.
  I used this.errors.length to refer to it. It seems to treat .length as a key in errors.</p>
  
  <pre><code>data(){
      return {
          name: null,
          price: null,
          description: null,
          roomTypes: {},
          errors: {},
      }
  },
  methods: {
      addRoomType: function(){
  
          if(this.name &amp;&amp; this.description &amp;&amp; this.price &amp;&amp; this.this.description&gt;10){
              axios.post('/admin/room-types',{
                  name: this.name,
                  price: this.price,
                  description: this.description
              }).then((response)=&gt;{
                  this.errors = {};
                  this.roomTypes.push(response.data);
              }).catch((error)=&gt;{
                  this.errors = error.response.data;
                  console.error(error.response.data);
              });
          }
          //this.errors = {};
          if(!this.name){
              this.errors.name = "Please enter a name.";
              console.log(this.errors.name);
          }
  
          if(!this.description){
              this.errors.description = "Please enter a description.";
              console.log(this.errors.description);
          }
  
          if(!this.price){
              this.errors.price = "Please enter a price.";
              console.log(this.errors.price);
          }
  
          if(this.errors.length){
              console.log(this.errors.length);};
  </code></pre>
  
  <p>I want to be able to get the size of the errors object so i can check if it is empty.</p>