einfuehrung
This commit is contained in:
parent
739cd813d4
commit
0ac8cea673
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"deno.enable": true
|
||||
}
|
||||
22
src/01-einfuehrung/beispiel.js
Normal file
22
src/01-einfuehrung/beispiel.js
Normal file
@ -0,0 +1,22 @@
|
||||
function add(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
console.log(add(5, {num: "10"}.num))
|
||||
|
||||
const user = {
|
||||
name: 'John',
|
||||
age: 30
|
||||
}
|
||||
|
||||
console.log(user.address)
|
||||
|
||||
|
||||
class Person {
|
||||
constructor(name, age) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
}
|
||||
}
|
||||
|
||||
const person = new Person("John", "30");
|
||||
29
src/01-einfuehrung/beispiel.ts
Normal file
29
src/01-einfuehrung/beispiel.ts
Normal file
@ -0,0 +1,29 @@
|
||||
function addTs(a: number, b: number): number {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
console.log(addTs(5, 10));
|
||||
|
||||
type User = {
|
||||
name: string;
|
||||
age: number;
|
||||
address?: string;
|
||||
};
|
||||
|
||||
const user: User = {
|
||||
name: 'John',
|
||||
age: 30,
|
||||
};
|
||||
|
||||
console.log(user.address);
|
||||
|
||||
class Person {
|
||||
name: string;
|
||||
age: number;
|
||||
constructor(name: string, age: number) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
}
|
||||
}
|
||||
|
||||
const person = new Person('John', 30);
|
||||
Loading…
x
Reference in New Issue
Block a user