-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathtest-output.txt
20 lines (15 loc) · 907 Bytes
/
test-output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Querying Perplexity AI using sonar-pro for: What is TypeScript?
TypeScript is a strongly typed programming language that builds on JavaScript by adding static typing[1][2]. Key features include:
- Static type checking at compile time to catch errors early[4]
- Type annotations to specify variable and function types[4]
- Object-oriented programming features like classes and interfaces[5]
- Compiles to plain JavaScript that can run in any environment[4]
Example of TypeScript code with type annotations:
```typescript
function greet(name: string): string {
return `Hello, ${name}!`;
}
let user: string = "Alice";
console.log(greet(user)); // Output: Hello, Alice!
```
TypeScript offers benefits like improved tooling, better code quality, and easier refactoring compared to plain JavaScript[5]. It's widely used for building large-scale applications and is popular in frameworks like Angular[2][5].