Skip to content

Instantly share code, notes, and snippets.

@rabeesh
rabeesh / async-await
Last active March 1, 2018 11:37
Async/await in normal way
class Domain {
constructor(config, dal) {
this.dal = dal;
this.config = config;
this.domainName = null;
this.sslRedirect = false;
this.paymentRequired = false;
// Recursively concat nested array
function concatR(ar, result) {
result = result || []
for(var i=0; i < ar.length; i++) {
if (Array.isArray(ar[i])) {
// calling with inner array
concatR(ar[i], result)
} else {
result.push(ar[i])
}