Lodash: Hey guys, How do i check if the current value of key is undefined

const _ = {
has: function(object, key){

const hasValue = Boolean(object.key!=undefined&&object.key.value!=null);

return hasValue;

}
};

/*
1 - _.has() is defined - Passed!
2 - Returns true if an object has a value at a specified key - Failed: _.has({“key”: “value”}, “key”) returned false instead of true.
3 - Returns false if an object does not have a value at a specified key - Passed!
*/