Hello world

    • Deno can run JavaScript or TypeScript out of the box with no additional tools or config required.

    In this JavaScript example the message is printed to the console and the code ensures the name provided is capitalized.

    This TypeScript example is exactly the same as the JavaScript example above, the code just has the additional type information which TypeScript supports.

    Command: deno run hello-world.ts

    1. function hello(name: string): string { return "Hello " + capitalize(name);}
    2. console.log(hello("john"));console.log(hello("Sarah"));console.log(hello("kai"));