JavaScript Object-Advanced Concept- Questionnaire
1. What is the differences of objects versus primitives? The fundamental difference is objects are stored and copied "by reference" where as primitive values: strings, numbers, booleans etc are always copied "as a whole value". 2. Is it possible to create a "real copy" in JavaScript ? Yes , we can use Object.assign for so called "shallow copy" . Nested object are copied by using _.cloneDeep(obj) function provided by load ash. 3. In regards to memory management in JavaScript , what happens when some thing is not needed any more? The main concept of memory management in JavaScript is reachability. There is a background process in the JavaScript engine that is called garbage collector. It monitors all objects and removes those that have become unreachable. Only incoming ones make an object reference. 4. Can functions be stored as object properties in JavaScript? Yes . The functions can be stored as properties and are called as methods. 5. ...