export const sleep = ms => {
  return new Promise(resolve => setTimeout(resolve, ms))
}

export function getLastElementByIndex(inArr) {
  return inArr.reduce((prev, current) => (prev.index > current.index ? prev : current))
}
