SOURCE

function myGet(target, key) {
    const keys = key.split('.');
    if (keys.length === 1) return target[key];
    for(let i = 0; i < keys.length; i++) {
        const it = keys[i];
        target = target[it];
        if (!target) {
            return false
        }
    }

    return true
    
}

res = myGet({
    a: {
        b: {
            c: {
                d: 1
            }
        }
    }
},  'a.b.c.d')

console.log(res)
console 命令行工具 X clear

                    
>
console