cyberfly
11/23/2018 - 7:14 AM

Javascript filter unwanted records from array

    let users = state.users;
    
    let current_user_id = getters.currentUser.id;

    // get the remaining user object

    let filtered_users = users.filter(function (user) {

        if (user.id != current_user_id) {
            return true;
        }

        return false;
    });