var obj = [
{ profile: { last_login: null } },
{ profile: { last_login: true } },
{ profile: { last_login: null } },
{ profile: { last_login: true } },
{ profile: { last_login: null } }]
//With filter and map
console.log("With filter and map: ",
obj.map((x, i) => ({ ...x.profile, i }))
.filter(x => !x.last_login)
.map(x => x.i));
//With reduce
console.log("With reduce: ",
obj.reduce((p, c, i) => (!c.profile.last_login && p.push(i), p), [])
)