how to write a funtion in an eternal js file code example Example: how to add javascript in html <script src="script.js"></script>