¡GoConqr estrena diseño! Cuéntanos qué te parece.

Fichas

4. Variables, scope and memory

Ioana Cosmina JavaScript Inglés 14 fichas

Fichas del conjunto (14)

  1. 1What are reference values?Objects stored in memory that can be accessed only by reference - JS does not allow direct access of memory locations.
  2. 2Can you change in any way reference values?Yes, you can add, change, or delete properties and methods at any time, in contrary to primitive values.
  3. 3How is a primitive value copied?The value stored on the variable is created and copied into the location for the new variable. Both of them can now be used separately with no side effects.
  4. 4How is a reference value copied?The new variable is actually a pointer to an object stored on the heap. The two variables point to the exactly same object. Changes to one are reflected on the other.
  5. 5How are arguments passed?All function arguments are passed only by value.
  6. 6instanceofUsed for reference values, to determine what type of objects are they.
  7. 7What does the execution context of a variable or function?Defines what other data it has access to and how it should behave. Each function call has its own execution context.
  8. 8What is the global execution context?The outermost one. In web browsers it is the window object.
  9. 9When is an execution context destroyed?When an execution context has executed all of its code, it is destroyed taking with it all of the variables and functions defined in it.
  10. 10What is a scope chain?When code is executed in a context, a scope chain of variable objects is created to provide ordered access to all variables and functions that the execution context has access to.
  11. 11Can local contexts access outer ones?An inner context can access everything from all outer contexts through the scope chain, but the outer contexts cannot access anything within an inner context.
  12. 12What is a garbage-collected language?The execution environment is responsible for managing the memory required during code execution.
  13. 13What are the two strategies used for garbage-collection in JS?Mark-and-Sweep
    Reference Counting
  14. 14What is the best way to optimize memory usage?By keeping around only data that is necessary for the execution of the code. When data is no longer necessary, it is best to set the value to null, especially for global values and properties of global objects.

Información

Descripción
JavaScript Fichas sobre 4. Variables, scope and memory, creado por Ioana Cosmina el 26/01/2020.
Creado por
Ioana Cosmina
Visitas
0
Etiquetas
javascript
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?