Move CDATA to js file

I would like to move this CDATA from HTML source to custom JS file.

Here’s an example of what I’m talking about:

<script type="text/javascript"> /* <![CDATA[ */ var cnArgs = {"ajaxUrl":"https:\/\/www.example.com\/wp-admin\/admin-ajax.php","nonce":"de57d13a7a","hideEffect":"fade","position":"bottom","onScroll":"0","onScrollOffset":"100","onClick":"0","cookieName":"cookie_notice_accepted","cookieTime":"2592000","cookieTimeRejected":"2592000","cookiePath":"\/","cookieDomain":"","redirection":"0","cache":"1","refuse":"1","revokeCookies":"0","revokeCookiesOpt":"automatic","secure":"1","coronabarActive":"0"}; /* ]]> */ </script> 

to…

<script type="text/javascript" src="cdata.js"></script> 

Is it possible to do it like that?