I hereby claim:
- I am nick-triller on github.
- I am nicktr (https://keybase.io/nicktr) on keybase.
- I have a public key ASB0up725PeaWQy8vOSPv2C-fdsqqxexDALcJcYd3vTN8Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
const data = ['Nick', 'Zeeshan', 'Stephan', 'Armin', 'Mikalai', 'Zeeshan', 'Björn'] | |
console.log(hasDuplicates(data)) | |
function hasDuplicates(data) { | |
const seen = {} | |
for(elem of data) { | |
if (seen[elem]) { | |
return true; | |
} else { |
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
'use strict'; | |
function rand(min, max) { | |
return Math.random() * (max - min) + min; | |
} | |
function promiseFactory(id, msg) { | |
return new Promise((resolve, reject) => { | |
let timeout = rand(1, 1000); | |
setTimeout(() => { |