Skip to content

Instantly share code, notes, and snippets.

View walterspieler's full-sized avatar
🇪🇺

Matt Walterspieler walterspieler

🇪🇺
View GitHub Profile
const tls = require('tls')
const fs = require('fs')
const PORT = 6001
const HOST = '0.0.0.0'
module.exports = (app) => {
const Xml = app.drivers.xml
const Encoder = app.drivers.encoder

Keybase proof

I hereby claim:

  • I am walterspieler on github.
  • I am mwalterspieler (https://keybase.io/mwalterspieler) on keybase.
  • I have a public key ASBfGz9PXaqPTreYdoOLLVndQejLW2jbxGgYKoFguTyucQo

To claim this, I am signing this object:

@walterspieler
walterspieler / using-Array.prototype.flat().js
Created March 21, 2019 12:32
Flatten an array with ES6
const multiDimensionalArray = [ [1, 2], [3, 4], [5, 6] ];
const flattenedArray =multiDimensionalArray.flat();
console.log(flattenedArray) // [1, 2, 3, 4, 5, 6]
// This methods accepts one argument to choose the depth of the flattening.
const multiDimensionalArray = [[ [1, 2]], [3, 4], [5, 6] ];
multiDimensionalArray.flat(2);
console.log(flattenedArray) // [1, 2, 3, 4, 5, 6]