Hacker News new | ask | show | jobs
by techsin101 1270 days ago
I'd prefer it like this...

// get users older than 90

a = data.results;

b = a.filter(u => u.dob > 123456)

seniorUsers = b.map(x => {name: x.name, age: x.age})

// self contained

// comes out with one final var that is named to be used later on

// other vars are obviously meant to be ignored and just placeholders

// comment explains what is happening so each var doesn't need sacrifice comprehension speed

1 comments

Gonna need parens around that object constructor. ;)
.... Always