From b134df19da96c83230434801a8acbf7d450b3863 Mon Sep 17 00:00:00 2001 From: tanggd Date: Tue, 23 Jul 2024 22:19:29 +0800 Subject: [PATCH] docs: Update docs for get (#278) * docs: Update chunk.md * Squashed commit of the following: commit 14c8b1108a3aa6d45955c7dcd94a74598c9b4737 Author: tanggd Date: Mon Jul 22 13:17:17 2024 +0800 docs: Update docs for get commit 9b7b7ac41f7484753723b32f4d624da4c8bfe4e6 Author: tanggd Date: Fri Jul 19 17:00:59 2024 +0800 docs: Update chunk.md --------- Co-authored-by: tanggd --- docs/ko/reference/compat/object/get.md | 13 ++++++++----- docs/reference/compat/object/get.md | 13 ++++++++----- docs/zh_hans/reference/compat/object/get.md | 13 ++++++++----- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/docs/ko/reference/compat/object/get.md b/docs/ko/reference/compat/object/get.md index 2435a8b7..15b3d050 100644 --- a/docs/ko/reference/compat/object/get.md +++ b/docs/ko/reference/compat/object/get.md @@ -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 ``` \ No newline at end of file diff --git a/docs/reference/compat/object/get.md b/docs/reference/compat/object/get.md index 2531a01f..746f7155 100644 --- a/docs/reference/compat/object/get.md +++ b/docs/reference/compat/object/get.md @@ -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 ``` \ No newline at end of file diff --git a/docs/zh_hans/reference/compat/object/get.md b/docs/zh_hans/reference/compat/object/get.md index 51db93fa..6cf341ef 100644 --- a/docs/zh_hans/reference/compat/object/get.md +++ b/docs/zh_hans/reference/compat/object/get.md @@ -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 ``` \ No newline at end of file