Syntax Sunday Snobbery!
Some people are annoyed when I use x as a parameter name in the functions passed to functions such as filter, map or find:
let kittens = animals.find(x => x.type === 'cat' && x.ageMonths < 12)
someOrder = { | |
items: [ | |
{ name: 'Dragon food' , price: 8, quantity: 8 }, | |
{ name: 'Dragon cage (small)', price: 800, quantity: 2 }, | |
{ name: 'Shipping', price: 40, shipping: true } | |
] | |
} | |
orderTotal = (order) => { | |
totalNormalItems = |
X-Patreon-Event: pledges:create | |
Cf-Ray: 3aed45fb2c8851b2-SJC | |
User-Agent: python-requests/2.5.2 CPython/3.6.2 Linux/3.13.0-132-generic | |
Content-Type: application/json | |
Cf-Visitor: {"scheme":"https"} | |
Accept-Encoding: gzip | |
Accept: */* | |
Total-Route-Time: 0 | |
Content-Length: 25417 | |
Via: 1.1 vegur |
let createGetUserName = require('./di-lib.js') | |
const getUsername = createGetUserName(database) | |
getUserName(1).then(name => console.log('the name of user 1 is', name)) |
let getUserName = require('./not-di-lib.js') | |
getUserName(1).then(name => console.log('the name of user 1 is', name)) |
let createGetUserName = require('./di-lib.js') | |
const getUsername = createGetUserName(database) | |
getUserName(1).then(name => console.log('the name of user 1 is', name)) |
const response = await fetch(`https://catappapi.herokuapp.com/users/${userId}`) | |
const data = await response.json() | |
return data.imageUrl | |
} |
const socket = window.io('http://localhost:3001') | |
socket.on('events', message => console.log('events', message) ) |
const createChildLookupTable = categories => | |
categories.reduce((lookup, child) => | |
Object.assign({}, lookup, { | |
[child.parent]: (lookup[child.parent] || []).concat(child) | |
}), {}) | |
const makeTree = (childLookup, parent) => | |
(childLookup[parent] || []).reduce((node, child) => | |
Object.assign({}, node, { | |
[child.id]: makeTree(childLookup, child.id) |
This week I tweeted and tooted this question:
”What do you think are critical traits in a programmer? NOT to be super 10x or anything - just to feel good and function well professionally.”
Link to full threads here: [https://twitter.com/mpjme/status/855691565460848640]