In Javascript, there isn't a Garbage collector system, so you need to handle yourself the resources management part of your application, and this could be a big mess.
Why? JavaScript has automatic garbage collection mechanism.
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
C# has garbage collection and no way to manually free resources. It works the same as javascript, you can set all references to an object to null and then it will eventually be garbage collected. You can also force the garbage collector to run, but that is highly discouraged in almost all circumstances.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why? JavaScript has automatic garbage collection mechanism.
Yes sorry, I mean than "you cannot manually deallocate resources" like c# or c++ malloc or free
Unfortunately we just have to trust that is what is happening but it's okay, we don't want to panic anyone. Can you see what I did there.
Sure you can, if you
null
an Object then it will be marked for GC. It may not happen immediately, but when the GC runs it will be cleaned up.developer.mozilla.org/en-US/docs/W...
C# has garbage collection and no way to manually free resources. It works the same as javascript, you can set all references to an object to
null
and then it will eventually be garbage collected. You can also force the garbage collector to run, but that is highly discouraged in almost all circumstances.