Skip to content

Commit 366d27c

Browse files
authored
feat: add ts solution to lc problem: No.2727 (doocs#1471)
1 parent b3e7f5d commit 366d27c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

solution/2700-2799/2727.Is Object Empty/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ function isEmpty(obj: Record<string, any> | any[]): boolean {
7777
}
7878
```
7979

80+
```ts
81+
function isEmpty(obj: Record<string, any> | any[]): boolean {
82+
return Object.keys(obj).length === 0;
83+
}
84+
```
85+
8086
### **JavaScript**
8187

8288
```js

solution/2700-2799/2727.Is Object Empty/README_EN.md

+6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ function isEmpty(obj: Record<string, any> | any[]): boolean {
6363
}
6464
```
6565

66+
```ts
67+
function isEmpty(obj: Record<string, any> | any[]): boolean {
68+
return Object.keys(obj).length === 0;
69+
}
70+
```
71+
6672
### **JavaScript**
6773

6874
```js

0 commit comments

Comments
 (0)