EDIT: Made clearer that the need is to determine if I can add properties to a value, not if a value can have its own properties.
Is there a way to check if is possible to add properties to a value?
For example, if I have this code:
function test( value ) {
// return true if it is possible to add properties to value
}
Other than actually adding a property value to test, is there a reliable way to deduce if value is something that properties can be added to?
For example, I know an object can have properties and undefined can't, but I'm not keen on creating a list of known things that might not suffice in the future. Is something like instanceof object sufficient?