What are the differences in javascript stack memory allocation
This article mainly introduces the differences between javascript stack memory allocation, the article is very detailed, has a certain reference value, interested friends must read it!
Description
1. Stack, the operating system automatically allocates and releases the parameter values and local variable values of the storage function. Its mode of operation is similar to that of stacks in data structures. Heap, complex types of storage (objects) are usually allocated and released by programmers.
2. Simple data types are stored in the stack, while complex data types are stored in the heap.
Example
Let a = 12; let b = a; let c = {name: 'xiaoHua'}; b = 13; console.log (a, c)-let a = {n xiaoHua' 1}; let b = a A. x = a = {/ / such a sequence equals to assign NRV 2}; console.log (a.x, b) in turn from left to right; this is all the content of the article "what are the differences in javascript stack memory allocation?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!