Assuming you want to print "Shayan is a cool dude" in the console using TypeScript, you can use string interpolation and variables to achieve this. Here's how:
index.ts70 chars3 lines
In the above code snippet, we define a constant name
and set it to the value 'Shayan'
. Then, we use string interpolation to print out the message "Shayan is a cool dude" using the ${}
syntax. The variable name
is referenced inside the ${}
placeholder to insert the value of name
into the output string.
When you run this code in the console using a TypeScript compiler, it should output:
index.ts22 chars2 lines
gistlibby LogSnag