This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const withFunction = { | |
myOwnProp: 42, | |
myOwnFunc: function () { | |
return this.myOwnProp | |
} | |
} | |
const withArrow = { | |
myOwnProp: 42, | |
myOwnFunc: () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Model = Model | |
{ name :: String | |
, gender :: String | |
, loading :: Bool | |
, homeworld :: String | |
} deriving (Show) | |
data PersonResponse = PersonResponse | |
{ personName :: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const updateStatus = (order, newStatus) => { | |
if (order.status === undefined) { | |
order.status = 'ORDERED' | |
} | |
//... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.post('/customers/:customerId/orders/', (req, res) => { | |
if (req.body.items.length === 0) { | |
res.status(400).end() | |
} else { | |
MongoClient.connect(url, function (err, client) { | |
if (err) { | |
console.error(err) | |
} | |
const db = client.db(dbName) | |
const collection = db.collection('orders') |
OlderNewer