Skip to content

What is Metadata? #86

@mikhailrojo

Description

@mikhailrojo

Can I ask what is metadata exactly? I haven't found anywhere any good description, only methods JsDoc.

According to Metadata Proposal you offer to add to any JS Object unreachable property [[Metadata]]. But anyone could read and write to it with specialized methods? Like 'defineMetadata', 'getOwnMetadata'? So it is more like getter/setter from OOP without direct access to property.

So I can make something like this to copy the behavior?

//structure will look like: 
const obj = {};

obj['Metadata'] = {
  customProperty1: {
    property: 'someValue'
  }
}
// Methods would look like this: 
Object.prototype.defineMetadata = function(metadataKey, metadataValue, target, key) {
  this['metadata'][metadataKey] = {key: metadataValue};
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions