Visit my blog or connect with me on Twitter
git init
or
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
// async function | |
async function fetchAsync () { | |
// await response of fetch call | |
let response = await fetch('https://api.github.com'); | |
// only proceed once promise is resolved | |
let data = await response.json(); | |
// only proceed once second promise is resolved |
Visit my blog or connect with me on Twitter
git init
or
:first-child i === 0 | |
:last-child i === arr.length - 1 | |
:only-child arr.length === 1 | |
:nth-child(even) i % 2 | |
:nth-child(odd) !(i % 2) | |
:nth-child(n) i === n - 1 | |
:nth-last-child(n) i === arr.length - n |