There is a limitation when it comes to circular references. Z = null // The 'a' property of the object originally in x // has zero references to it. However its 'a' property is still referenced by // the 'z' variable, so it cannot be freed. Y = "mozilla" // The object that was originally in 'x' has now zero // references to it. This object now has 2 references: one as a property, // the other as the 'z' variable. a // Reference to 'a' property of the object. X = 1 // Now, the object that was originally in 'x' has a unique reference // embodied by the 'y' variable. let y = x // The 'y' variable is the second thing that has a reference to the object. Obviously, none can be garbage-collected. The other is referenced by virtue of being assigned to the 'x' variable. One is referenced by the other as one of its properties. Unicode character class escape: \p // 2 objects are created.Character class escape: \d, \D, \w, \W, \s, \S.Enumerability and ownership of properties.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |