Sobes.tech
Junior — Senior

What will console.log output in example #25

livecode

Task condition

Determine what will be printed to the console when the following code is executed.

 const accountService = {
  activeFilter: 'active',
  userList: [
    { name: 'Alex', status: 'active' },
    { name: 'Nick', status: 'deleted' },
  ],
  fetchFilteredUsers: function () {
    return this.userList.filter(function (person) {
      return person.status === this.activeFilter;
    });
  }
};

console.log(accountService.fetchFilteredUsers());