title: How to get next N element from array?
body: <p>Need a function which return next N elements from given array, with given offset, but when offset larger then array length, it must return elements at the beginning of array.</p>
  
  <p><strong>Interface:</strong><br>
  <code>slice2(array, chunk, offset);</code>  </p>
  
  <p><strong>Examples:</strong></p>
  
  <p><code>var array = [1,2,3,4,5];</code><br>
  <code>slice2(array,2,2)</code> Output: [3,4]<br>
  <code>slice2(array,2,4)</code> Output: [5,1]<br>
  <code>slice2(array,3,4)</code> Output: [5,1,2]</p>