This is not directly possible with Svelte. The reason for this is because those variables do not exists on the global scope of your document, they are encapsulated by the browser into the app and shielded from outside interference.
One way around this would be to explicitly define a way to do this
xxxxxxxxxx
<script>
let name = 'world';
window.setName = (val) => name = val;
</script>
<h1>Hello {name}!</h1>
Now you can do window.setName('test') in the console and it will change the value of name