title: Javascript: How to pass an array with specific index to a function?
body: <p>Let say I have an array:-</p>
  
  <pre><code>var arr = [0,1,2,3,4]
  </code></pre>
  
  <p>I need to pass only "1" and "4" to function below</p>
  
  <pre><code>function func1(onlyArray){
       //Do Stuff...
  }
  </code></pre>
  
  <p>I have tried both but both also dont work</p>
  
  <pre><code>func1(arr[1,4])
  func1(arr[[1],[4]])
  </code></pre>
  
  <p>Can anyone show me the right way or give me some keyword?</p>