// Prints information about the object prototype chain

function getPrototypeChain(obj){
    let list = [];
    while(obj = Object.getPrototypeOf(obj)){
        list.push(obj)
    }
    list.push(null)
    return list
}

Copy the code