- ๐ป TypeScript is a programming language developed by Microsoft ๐ that is a typed superset of JavaScript ๐. It offers features such as static typing ๐ โโ๏ธ, interfaces ๐ค, classes ๐ซ, modules ๐ฆ, and decorators ๐, making it easier to write and maintain large-scale applications. TypeScript code is transpiled to JavaScript code ๐ and can run in any JavaScript environment ๐, including web browsers ๐ and Node.js ๐. It has excellent tooling support ๐ ๏ธ and is a popular choice for building complex applications ๐๏ธ.
npm install -g typescript
Write this command in yout IDE's Terminal
Step 3 : Put all the html and js file inside the build folder & all the typescript file will be at the src folder
tsc --init
it will create tsconfig.json file
"rootDir": "./initializeTS/src", // here you give your src folder path
"outDir": "./initializeTS/build/js", // Here you give your jsvascript file path and 'build/js' will create js folder inside the build folder
// Add this line of code at the end of the tsconfig.json file
,
"include": [
"initializeTS/src"
]
Step 5 : run this command after make changes in json file it will update all the changes of that are maked in json file.
tsc -w
- The TypeScript approach used in this code is to add
optional type annotations
to variables, parameters, and return types. This allows the compiler to catch type-related errors at compile time instead of runtime, which can help prevent bugs and improve the reliability of the code.
- In this code, the TypeScript approach used is to add type annotations to the variable i and to use the for loop to iterate through a section of an array based on the values of two variables, parenthesisCounter and finalParenthesis. The if statement inside the loop checks if the current element in the array is either a multiplication or division operator, and sets the toLoop variable to true if it is. If the element is not a multiplication or division operator, the toLoop variable is set to false. The toLoop variable is used later in the code to determine whether to continue looping or not.
-
๐ข A TypeScript scientific calculator is a program written in TypeScript language that allows users to perform mathematical operations.
-
โ โ โ๏ธ โ It provides functions for basic arithmetic operations such as addition, subtraction, multiplication, and division.
-
๐งฎ It also includes more advanced operations like exponentiation, trigonometric functions, and logarithmic functions.
-
๐ฅ๏ธ The calculator has a user-friendly and intuitive interface with buttons for all the common mathematical operations.
-
โฌโซ It features bracket operations, allowing users to group calculations and prioritize their execution order.
-
๐พ The calculator includes a memory function that allows users to store values for later use in calculations.
-
๐ป The input and output are displayed clearly on the screen for easy readability.
-
๐ฌ The TypeScript scientific calculator is a powerful tool for students, researchers, and professionals in various fields to perform a wide range of mathematical calculations.