How do JavaScript allocate memory for variables and why don't it require (data type) type while declaring a variable... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do JavaScript allocate memory for variables and why don't it require (data type) type while declaring a variable...

JavaScript memory, variable,data type

30th Jan 2019, 7:11 AM
sss
sss - avatar
1 Answer
+ 2
JavaScript is a higher level language than for example C. This means JS handles many things you have to do manually in C automatically. For example JS allocates the memory for you when you create an array and also takes care of data types so you can assign any type you want. Behind this "facade" JavaScript does the same as any other programming language, it just simplifies things (though this makes it obviously slower).
30th Jan 2019, 8:49 AM
Aaron Eberhardt
Aaron Eberhardt - avatar