mochacon3738 mochacon3738
  • 10-03-2020
  • Computers and Technology
contestada

After the following code runs, what will be the value of result? var x = 30; function get () { return x; } function set (value) { x = value; } set(10); var result = get(20);

Respuesta :

Veltany
Veltany Veltany
  • 14-03-2020

Answer:

Null

Explanation:

It entirely depends on the language you are using to implement this.

But generally by the rule of scope, "result" will return null since get() was not defined to accept any argument, and it neither know the global "x" not defined it's own x in the function.

Answer Link

Otras preguntas

Plants store their nutrients, and water in their: A.nucleus B.vacuole C.chloroplasts D.cell membrane
Last Year, a state university received 3,560 applications from boys. Of those applications, 35 Percent were from boys who lived in other states. Part A)How many
solve linear system using substitution y=6-2x 7x-y=3
What is the relationship between matter and elements
What bones are used to preform a sit up
correct order of human development
How can creation myths influence how the history of the world or a society is viewed?
What type of mRNA requires processing?
y - 2.1 = 7.5 what does the y equal
Which of the following cells shows the presence of a nucleus? Prokaryotic cell Eukaryotic cell Both prokaryotic and eukaryotic cell