Change language

#Typescript Basics PART 2 – Compiler #Visual Studio Code

Python functions
#Typescript Basics PART 2 - Compiler #Visual Studio Code

hey guys let us play with writing code in playground workspace using visible studio editor create a new folder named playground and open it in visible studio code by clicking the file menu and open folder let us start creating a new file name hello.js enter the code console.log hello world and run with typescript compiler it is transpiled typescript into javascript you can see js file generated in the same folder let us run js file using node command it will print the output as expected lets understand the basic sound type script compiler in visible studio you can see the visible studio course typescript version in the status bar when you open a typescript file step number one we need to create tsconfig.json file atsconfig.json file defines the typescript project settings create new file named tsconfig.json once you are in tsconfig.json file intellisense the shortcut is control plus space will help you along the way so that you can add the compiler options with the basic statements step 2 make the type script build the default execute run build task from the global terminal menu the shortcut is control shift b if you created a tsconfig.json file in the earlier this should present in the following picker drop down if you select the trc bill entry this will produce a helloworld.js file along with helloworld.js.map file in the workspace what are those dot map files dot map files are source map files that let tools map between the javascript code and the type script source files that created it many debuggers can consume these files so you can debug the typescript file instead of the javascript file if you select a tsc watch the typescript compiler watches for changes to your files and runs the transpiler on each change step number three make the typescript build the default you can also define the typescript build task as a default build task so that it is executed directly when triggering run build task to do so select configure default build task from the global terminal menu this shows you a picker with the available build task select type script dsc build which generates the following tasks dot json file in a dot vs code folder notice in task dot json we have a two attributes auto generated one attribute name is group and second attribute name is label so under the group we have a two properties one is kind and second one is is default after the configuration of the dsc build if you press ctrl shift b as you can see in figure in terminal saying start compiling in watch mode phone zero errors watching for file changes messages if we can check whether our bill options are configured correctly or not lets change the property of a console to log g so we will add extra g there you can see it in a problems its clearly saying that the property log does not exist on a type console

Shop

Gifts for programmers

Learn programming in R: courses

$FREE
Gifts for programmers

Best Python online courses for 2022

$FREE
Gifts for programmers

Best laptop for Fortnite

$399+
Gifts for programmers

Best laptop for Excel

$
Gifts for programmers

Best laptop for Solidworks

$399+
Gifts for programmers

Best laptop for Roblox

$399+
Gifts for programmers

Best computer for crypto mining

$499+
Gifts for programmers

Best laptop for Sims 4

$

Latest questions

PythonStackOverflow

Common xlabel/ylabel for matplotlib subplots

1947 answers

PythonStackOverflow

Check if one list is a subset of another in Python

1173 answers

PythonStackOverflow

How to specify multiple return types using type-hints

1002 answers

PythonStackOverflow

Printing words vertically in Python

909 answers

PythonStackOverflow

Python Extract words from a given string

798 answers

PythonStackOverflow

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

606 answers

PythonStackOverflow

Python os.path.join () method

384 answers

PythonStackOverflow

Flake8: Ignore specific warning for entire file

360 answers

News


Wiki

Python | How to copy data from one Excel sheet to another

Common xlabel/ylabel for matplotlib subplots

Check if one list is a subset of another in Python

How to specify multiple return types using type-hints

Printing words vertically in Python

Python Extract words from a given string

Cyclic redundancy check in Python

Finding mean, median, mode in Python without libraries

Python add suffix / add prefix to strings in a list

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

Python - Move item to the end of the list

Python - Print list vertically