Skip to content

Instantly share code, notes, and snippets.

@nickserv
nickserv / adminController.postAddVehicle.js
Last active September 13, 2021 02:39 — forked from stephepush/adminController.postAddVehicle.js
Excluding model/class properties in express
exports.postAddVehicle = ({ body }, res, next) => {
const car = new Car(body)
console.log(car)
return car
.save()
.then(() => {
res.redirect('/');
})
.catch(err => console.log(err))
}
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
const getPositions = chatLog => {
return chatLog.map((message, i) => {
const previous = chatLog[i - 1];
const next = chatLog[i + 1];
const messageIsJoinOrExit = message.messageType === "JOIN_OR_EXIT";
let previousIsJoinOrExit;
let nextIsJoinOrExit;
let previousIsFromSameUserAsMessage;
let nextIsfromSameUserAsMessage;
@nickserv
nickserv / function_invocation.js
Created June 18, 2017 21:55 — forked from myshov/function_invocation.js
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);