I use two methods to hide my js code, atob and eval.
When my code is ready I encode it to Base64 (by online tool) and cut to many parts somewhere in code. Next I decode string and run eval(atob( codePart1 + codePart2 ))
Write function to tmp file
function myHideCode() { alert("ok") }; window.myHideCode = myHideCode
Encode tmp file to Base64 (online tool) to variable e.g.
var default_jpg = CAgICAgCiAgICBjb25zdCBnZXRSYW5kb21BcmJpdHJhcnkgPSAobWluLCBtYXgpID0=
run somewhere in code
eval( atob(default_jpg) );
finally
window.myHideCode();