Answer the question
In order to leave comments, you need to log in
Is it possible to use dynamic memory in Typescript?
Is it possible to somehow use dynamic memory with typescript like in C++, or is it not necessary?
Thanks in advance
Answer the question
In order to leave comments, you need to log in
TypeScript does not and cannot have a different memory management model than in JS, because TypeScript is a superset of JS that adds static typing and a number of other goodies. Compiling from TS to JS is pretty straightforward, there is nothing like its own memory manager or other abstractions.
Therefore, the need for manual memory management (do you understand this by dynamic memory?) in TS comes down to the need for manual memory management in JS. I'm not sure the last question is correct, because a language is a set of ready-made solutions, among which the memory management strategy is a fairly basic thing, a lot depends on it in the language and its ecosystem, so such a thing will not change just like that, usually such decisions are made when the language was created and are no longer revised.
So the question turns to which language you need. Want to try writing browser code in C++? Try experimenting with WebAssembly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question