-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.ts
81 lines (63 loc) · 1.4 KB
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// classes
// attributes
// access class attributes by usint "this"
// class attributes are public by difault
// import { log } from "console";
/**
* @description - first way to create private attributes
private name;
private age;
constructor(name: string, age: number) {
this.name = name;
this.age = age;
}
/**
* @description - second way to create private attributes using constructor
constructor(private name: string, private age: number) {}
*/
/* class Person {
constructor(private name: string, private age: number) { }
getSummary() {
return `my name is ${this.name}, and my age is ${this.age}`
}
}
const alejo = new Person('alejo', 28)
console.log(alejo.getSummary());
console.log(alejo);
*/
/* const payload = {
coments: [
{
comment: "first comment"
}
]
}
const objKeys = Object.keys(payload).includes('comments');
console.log(objKeys);
*/
/* let a = 1;
const function1 = function() {
console.log(a);
a = 2
}
a = 3;
const function2 = function() {
console.log(a);
}
function1();
function2() */
/* const message: Message = {
id: 1,
title: 'hello',
text: 'world',
comments: [{
comment: 'hello'
}],
reactions: '',
visible: true
}
console.log(message);
console.log(typeof(message.comments[0].comment));
*/
// const dir = `${__dirname}/../**/*.entity.ts`
// console.log(dir);