3 ms·
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
by techsin101 4y 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
- sli 4y agoGonna need parens around that object constructor. ;)
- techsin101 4y ago.... Always