Javascript
Getting Started with Deno — Hands On

Command Line Arguments Solution

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

Here's one possible solution to the assignment, where you accept a name as the command line argument for the "Hello, world" message:

// command-line-arguments.ts

console.log(`Hello, ${Deno.args[0]}!`);

You can run the file like this:

deno run command-line-arguments.ts Preston

That will result in the following output:

Hello, Preston!
 

I finished! On to the next chapter