Is struct data structure in c++ likely to be the same with object data structure in javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is struct data structure in c++ likely to be the same with object data structure in javascript

10th May 2020, 9:40 AM
Dexterous Godson
Dexterous Godson - avatar
2 Answers
+ 1
Objects in js are similar to classes in c++, but only looking at them from outside. If you go deeper and look to how they work you'll see that objects in js are based on a prototype chain. Structs by the way are quite different...they don't have keys and can't contain functions (methods)...structs are more like arrays in which you can store different data types, in the end they become users defined data types.
10th May 2020, 9:51 AM
Alessandro Palazzolo
Alessandro Palazzolo - avatar
0
Thanks Alessandro Palazzolo for the explanation, I appreciate
10th May 2020, 4:52 PM
Dexterous Godson
Dexterous Godson - avatar