docs: Update docs for get (#278)

* docs: Update chunk.md

* Squashed commit of the following:

commit 14c8b1108a3aa6d45955c7dcd94a74598c9b4737
Author: tanggd <tanggd11@foxmail.com>
Date:   Mon Jul 22 13:17:17 2024 +0800

    docs: Update docs for get

commit 9b7b7ac41f7484753723b32f4d624da4c8bfe4e6
Author: tanggd <tanggd11@qq.com>
Date:   Fri Jul 19 17:00:59 2024 +0800

    docs: Update chunk.md

---------

Co-authored-by: tanggd <tanggd11@foxmail.com>
This commit is contained in:
tanggd 2024-07-23 22:19:29 +08:00 committed by GitHub
parent 3911ae8cfc
commit b134df19da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 15 deletions

View File

@ -52,13 +52,16 @@ function get(object: unknown, path: PropertyKey | readonly PropertyKey[], defaul
### 예시
```typescript
import { get } from 'es-toolkit/compat';
const obj = {
a: {
b: 4
}
}
console.log(obj, 'a.b') // 4
console.log(obj, ['a', 'b']) // 4
console.log(obj, ['a', 'c']) // undefined
console.log(obj, ['a', 'c'], null) // null
};
get(obj, 'a.b'); // 4
get(obj, ['a', 'b']); // 4
get(obj, ['a', 'c']); // undefined
get(obj, ['a', 'c'], null); // null
```

View File

@ -52,13 +52,16 @@ function get(object: unknown, path: PropertyKey | readonly PropertyKey[], defaul
### Examples
```typescript
import { get } from 'es-toolkit/compat';
const obj = {
a: {
b: 4
}
}
console.log(obj, 'a.b') // 4
console.log(obj, ['a', 'b']) // 4
console.log(obj, ['a', 'c']) // undefined
console.log(obj, ['a', 'c'], null) // null
};
get(obj, 'a.b'); // 4
get(obj, ['a', 'b']); // 4
get(obj, ['a', 'c']); // undefined
get(obj, ['a', 'c'], null); // null
```

View File

@ -52,13 +52,16 @@ function get(object: unknown, path: PropertyKey | readonly PropertyKey[], defaul
### 示例
```typescript
import { get } from 'es-toolkit/compat';
const obj = {
a: {
b: 4
}
}
console.log(obj, 'a.b') // 4
console.log(obj, ['a', 'b']) // 4
console.log(obj, ['a', 'c']) // undefined
console.log(obj, ['a', 'c'], null) // null
};
get(obj, 'a.b'); // 4
get(obj, ['a', 'b']); // 4
get(obj, ['a', 'c']); // undefined
get(obj, ['a', 'c'], null); // null
```