I hereby claim:
- I am rg1220 on github.
- I am rg1220 (https://keybase.io/rg1220) on keybase.
- I have a public key ASC2TiWrFpbyn1difOPAOcV3m67k8XmIVhVB4NFU0D6rMwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/** | |
* Recursive function to flatten the current array level | |
* @param {Array<any>} arr - The array to flatten | |
* @returns {Array<any>} New flattened array | |
*/ | |
const flatten = (arr) => { | |
const newArray = []; | |
arr.forEach((item) => { | |
if (Array.isArray(item)) { | |
newArray.push(...flatten(item)); |
var express = require('express'); | |
var router = express.Router(); | |
router.use(function (req, res, next) { | |
User.findOne(1234, function(err, user) { | |
if (err) { | |
console.log(err); | |
res.json({ error: 'There was an error' }); | |
} | |
else { |