@Antonin_JubaultSRF25 ,
The Javascript API needs a LOT of work. I don't like using it.
Try this dumb work-around instead:
Acad.Editor.executeCommand('(prompt "\\nRegistered ZEN command.")');
Good luck figuring out how to post content with strings or quotes. Would probably have to create your own function to edit string content.
Another approach you could do it just open a ToolPalette that hosts a local web page. This would allow you to at least see your console.logs...
Would look like this...
1) Create simple HTML file "test.html":
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="https://df-prod.autocad360.com/jsapi/v4/Autodesk.AutoCAD.js"></script>
<title>Sample App</title>
</head>
<body>
<h1>Hello World</h1>
<script>
console.log("I'm in the console!");
</script>
</body>
</html>
2) Create simple palette via JS API "test.js":
Acad.Application.addPalette("My Test Palette", "c:/users/me/folder/test.html");
3) Create command via AutoLISP:
;; Opens my test tool palette
(defun c:TEST ( / filePath)
(setq filePath "c:\\users\\me\\folder\\test.js")
(if (findfile filePath)
(command "_.WEBLOAD" "_l" filePath)
;else
(prompt (strcat "\nCould not locate JavaScript file:\n" filePath))
);if
(princ)
);defun
4) Run TEST command. Palette will open:

5) click inside palette somewhere to set it active. Then press F12 to open developer screen:

Best,
~DD