Skip to content

Instantly share code, notes, and snippets.

@jakelacey2012
Last active August 21, 2017 13:07
Show Gist options
  • Save jakelacey2012/e1fbc255937c45ffcab9c6180e25fec7 to your computer and use it in GitHub Desktop.
Save jakelacey2012/e1fbc255937c45ffcab9c6180e25fec7 to your computer and use it in GitHub Desktop.
// create something which returns a boolean, telling me if all the objects in the array are valid
const x = [
{ y: 10, z: 22 },
{ y: 2, z: 15 },
{ y: 3, z: 10 },
{ y: 123123123, z: 100 },
];
// x.every(i => i.y && i.z); is a good answer...
const f = () => {
console.log('A')
setTimeout(function() {
console.log('C');
}, 0);
const promise = new Promise(function(resolve, reject) {
resolve('B');
});
promise.then(d => console.log(d));
console.log('D');
}
f();
// another js question.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment