3 ms·
filteredData, noDateFilteredData, etc. gives me more info than a, b, etc. Let's say you have 2 lines of code where the variable a is used: a = expr, b = a.filt
by pestatije 4y ago
filteredData, noDateFilteredData, etc. gives me more info than a, b, etc.
Let's say you have 2 lines of code where the variable a is used: a = expr, b = a.filter(...)
Now I have to do the mental effort to see what expr is doing, instead of going directly to the second line and see filteredDateData = filteredData.filter(...)
- techsin101 4y agoI'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