Here's a simple method to insert javascript in the GeneratePress theme. This method doesn't require you to write any code to add the javascript.