me out? I have an array with events, i want to first filter by isActive and then do something with the array element, currently it looks like this:
                  
                  
                  const activeEvent = this.events.find(event => event.isActive).then((event) => {
                  
                  
                              // doSomething()
                  
                  
                            })
                  
                  
                
to find in array use array.find() it return instance of array or undefined. There is no then after find
Events aren't promises, they don't have a then() method. Find your event, then run whatever you need in activeEvent
Обсуждают сегодня