Skip to content

Sumary clarification #3824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 1-js/99-js-misc/07-weakref-finalizationregistry/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ You can [open this example in the sandbox](sandbox:weakref-finalizationregistry)

## Summary

`WeakRef` - designed to create weak references to objects, allowing them to be deleted from memory by the garbage collector if there are no longer strong references to them.
This is beneficial for addressing excessive memory usage and optimizing the utilization of system resources in applications.
`WeakRef` -- designed to create weak references to objects, allowing the JavaScript engine to remove them from memory when no strong references remain.
This helps optimize memory and system resource usage automatically.

`FinalizationRegistry` - is a tool for registering callbacks, that are executed when objects that are no longer strongly referenced, are destroyed.
This allows releasing resources associated with the object or performing other necessary operations before deleting the object from memory.
`FinalizationRegistry` -- is a tool for registering callbacks that are executed when an object without strong references is deleted.
This allows the programmer manually release resources associated with the object or perform additional cleanup tasks before the object is fully removed from memory.