The value found within the object based on the path, or the default value if the path is not found or results in an undefined value.
// Example 1: Accessing a nested property
const data = { user: { name: 'Alice', age: 25 } };
console.log(get(data, 'user.name', 'Unknown')); // Output: 'Alice'
// Example 2: Handling a missing property
const data = { user: { name: 'Alice', age: 25 } };
console.log(get(data, 'user.gender', 'Not specified')); // Output: 'Not specified'
Retrieves a value from an object using the specified path.