Change language

#Typescript Basics PART 2 – Compiler #Visual Studio Code

#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

#Typescript Basics PART 2 - Compiler #Visual Studio Code TypeScript: Questions

Shop

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

News

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method