Rationale
Inline JavaScript should be avoided in Lightning Components, except when referencing JavaScript controller methods in the component's markup. This is recommended in order to ensure proper separation of concern between model and view in your lightning components.
Scope
Lightning components