/**
 * Get a specified segment from the pathname.
 *
 * @param  {String} pathname
 * @param  {Number} segment
 * @return {Boolean}
 */
export function getPathnameSegment(pathname = window.location.pathname, segmentIndex = 0) {
  let segments = pathname.split('/');

  segments.splice(0,1);

  return segments[segmentIndex];
}

/**
 * Get a specified segment from the pathname.
 *
 * @param  {String} pathname
 * @param  {Number} segment
 * @return {Boolean}
 */
export function getPathnameSegment(pathname = window.location.pathname, segmentIndex = 0) {
  let segments = pathname.split('/');
  segmentIndex++;

  return segments[segmentIndex];
}

Update to increase index insted of splicing first item off array.
Update to increase index insted of splicing first item off array.
