1) What does "pass by value" mean in programming? a) The function is given the actual value stored in a variable. b) The function is given a reference to the actual variable. c) The function can directly modify the value of the variable. d) The function creates a new variable inside its scope. 2) In "pass by reference," a function receives: a) A new copy of the variable. b) The memory address of the variable. c) A constant value. d) An encrypted version of the variable. 3) Which of the following is true about "pass by value"? a) It allows the function to modify the original variable. b) It is more memory efficient when dealing with large objects. c) It ensures that the original variable remains unchanged. d) It is the default method in JavaScript for all types of variables. 4) In which scenario might "pass by reference" be more efficient than "pass by value"? a) When the function needs to modify an input variable. b) When dealing with small, simple variables. c) When maximum security and data protection is required. d) When the programming language does not support pointers or references. 5) Which of the following programming languages uses "pass by value" for primitive types by default? a) Python b) C++ c) JavaScript d) All of the above

Passing by Value and Reference

Classement

Style visuel

Options

Changer de modèle

Restauration auto-sauvegardé :  ?