Skip to content

Instantly share code, notes, and snippets.

View jomadoye's full-sized avatar
🏠
Working remotely

Jedidiah Omadoye jomadoye

🏠
Working remotely
  • Lagos, Nigeria
View GitHub Profile
@jomadoye
jomadoye / flatten.js
Created August 26, 2019 11:43
Flatten an array
//Flatten array
const flatten = (arr) => [].concat.apply([], arr);
//To use
const arrToFlatten = [
["1"],
["2"],
["3"],
["4"]
];
@jomadoye
jomadoye / intresting.js
Created July 29, 2019 18:31
The singleton pattern
const SingletonPattern = (() => {
let instantiated;
let init = () => {
// singleton
return {
publicMethod: () => {
console.log("hello world");
},
publicProperty: "test"