I assumed the point is whether you can do this from the repl? This is something Emacs is good at, but VSCode doesn't seem to be; in Emacs, you can do something like M-: (insert "FRED") RET and you'll see FRED appear in the current buffer. For good or (more rarely) for ill, the repl runs in the same context as the editing environment. You can use this to interactively develop extensions or just drive the editor from code as a one-off.
GP said “scripts”. But no, VSCode certainly doesn’t have that level of interactivity. On the other hand, the single-threadedness of Emacs is very annoying though.
Edit: My usage of Emacs has been reduced to mostly just magit and dired since ~2017, so I didn’t realize Emacs 26 added threads. Is it actually widely adopted? Things I do use these days, like package.el, are clearly still blocking.
Sorry, I wasn’t clear about it but I was talking about extension capabilities offered by stock VSCode. There’s nothing stopping third party extensions like Joyride from exposing the extension API in an REPL.