Lodash challenge: .has()

Could someone explain the difference between object.key and object[key], as per the challenge:

has(object, key){
  
    return object[key] !== undefined;
  }

…which works, versus:

has(object, key){
    
    return object.key !== undefined;
  }

I thought dot notation and square brackets were interchangeable?

Hello! In this case, object[key] returns the value which that key points to in the object, whereas .key is an event-listener, which can be used in dealing with keyboard inputs (see here for more on what that means).