function constructorName(obj) {
    // Note: This function could be replaced by optional chaining in Node.js 14+:
    // obj?.constructor?.name
    return obj && obj.constructor ? obj.constructor.name : '';
}
Safely returns the object constructor name.
@return {String} the name of the object constructor if it exists, empty string otherwise.