The Beaver Builder site has its own article concerning this: https://kb.wpbeaverbuilder.com/article/95-add-custom-javascript