index.js
function positionAfter (arr, prevChild) {
    var idx
    if (prevChild === null) {
      return 0
    } else {
      idx = findIndex(arr, prevChild)
      return (idx === -1) ? arr.length : idx + 1
    }
  }
function positionAfter (arr, prevChild) {
    var idx
    if (prevChild === null) {
      return 0
    } else {
      idx = findIndex(arr, prevChild)
      return (idx === -1) ? arr.length : idx + 1
    }
  }
function positionAfter ( arr , prevChild ) { var idx if ( prevChild === null ) { return 0 } else { idx = findIndex ( arr , prevChild ) return ( idx === - 1 ) ? arr . length : idx + 1 } }
using the Firebase API's prevChild behavior, we place each element in the list after it's prev sibling or, if prevChild is null, at the beginning
using the Firebase API s prevChild behavior we place each element in the list after it s prev sibling or if prevChild is null at the beginning