Skip to content

Instance variables share the same reference across instances (acting like class variables) #12

Description

@jchayan

For example:

Class('MyClass')({
    prototype: {
        property: [ ]
    }
});

var instance1 = new MyClass();
var instance2 = new MyClass();

instance1.property.push(1);

console.log(instance2.property):

Not good!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions