Skip to content

Instantly share code, notes, and snippets.

View EricDosReis's full-sized avatar

Eric dos Reis EricDosReis

View GitHub Profile
@EricDosReis
EricDosReis / contains-string-value.js
Created January 10, 2019 14:43
Javascript String snippets
const skater = {
nome: 'Corey Duffel',
twitter: '@duffel'
};
function containsStringValue(object, value) {
return Object.values(object)
.toString()
.includes(value);
}
@EricDosReis
EricDosReis / promise-and-async-await.js
Last active December 6, 2018 17:26
Promise and Async/Await
function getUser() {
return new Promise((resolve, reject) => {
setTimeout(() => {
return resolve({
id: 1,
name: 'Aladin',
birthDate: new Date()
});
}, 1000);
});