- **Deeply nested keys.** The `get` function is particularly useful when you need to access nested keys within an object without having to worry about whether each level of the object exists. It helps prevent errors that can occur when trying to access keys on `nil`. For example, if you try to access `obj.game.genshin.char.name` directly and any of those keys (`game`, `genshin`, `name` or `char`) do not exist, it would throw an error. Using `get` allows you to safely retrieve the value without risking an error, as it will simply return `nil` if the path does not exist.
0 commit comments