WordPress allows you to register your own script files with theme. This allows you to link the script file to WordPress generated page according to the dependencies and at right time. The traditional way of including scripts, i.e. by adding <script> tag in head or footer have some drawbacks. In traditional way, we hardcode the script and load it every time with page, even though it is not needed. But once you register the script with theme, it can be loaded dynamically. This allows you to improve your performance and make your website more faster.
So how to register a script?
Quite simple. Just use following syntax for registering your scripts.
<?php wp_register_script( $handle, $src, $deps, $ver, $in_footer ); ?>