- 💻 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.