src/Jsonq.php
public function nth($index, $object = false)
    {
        $this->prepare();

        $data = $this->_map;
        $total_elm = count($data);
        $idx =  abs($index);

        if (!is_integer($index) || $total_elm < $idx || $index == 0 || !is_array($this->_map)) {
            return null;
        }

        if ($index > 0) {
            $result = $data[$index - 1];
        } else {
            $result = $data[$this->count() + $index];
        }

        return $this->prepareResult($result, $object);
    }
public function nth($index, $object = false)
    {
        $this->prepare();

        $data = $this->_map;
        $total_elm = count($data);
        $idx =  abs($index);

        if (!is_integer($index) || $total_elm < $idx || $index == 0 || !is_array($this->_map)) {
            return null;
        }

        if ($index > 0) {
            $result = $data[$index - 1];
        } else {
            $result = $data[$this->count() + $index];
        }

        return $this->prepareResult($result, $object);
    }
public function nth ( $ index , $ object = false ) { $ this -> prepare ( ) ; $ data = $ this -> _map ; $ total_elm = count ( $ data ) ; $ idx = abs ( $ index ) ; if ( ! is_integer ( $ index ) || $ total_elm < $ idx || $ index == 0 || ! is_array ( $ this -> _map ) ) { return null ; } if ( $ index > 0 ) { $ result = $ data [ $ index - 1 ] ; } else { $ result = $ data [ $ this -> count ( ) + $ index ] ; } return $ this -> prepareResult ( $ result , $ object ) ; }
getting nth number of element of prepared data

@param int $index
@param bool $object
@return object|array|null
@throws ConditionNotAllowedException
getting nth number of element of prepared data