What is the difference between `drupal_add_js()` and `$form['#attached']['js'][]` ? <br/>
When is the purpose of using each of the above functions?<br/>

(I mean I know that it is used to attached js to say form if used inside form but when is `drupal_add_js` used and when is `$form['#attached']['js'][]` used ?)