afoysal
2854
4
Vue

Use for loop inside vue.js method

Posted 1 year ago by afoysal

How to use for loop inside vue.js method ?

createSelectedContacts: function(contacts){
      for(i = 0; i <= contacts.length; i++){
            this.selectedContacts.push(contacts[i].id);
      }
},

I am getting error here.

Please sign in or create an account to participate in this conversation.