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

what is the greatest common factor of 7 and 16
Find the distance from P to l. Line l contains points (-4,2) and (3,-5). Point P has coordinates (1,2).
All the dimensions of a triangle were multiplied by the same factor. If the base of the triangle went from 1 centimeter to 3 centimeters, the area of the triang
Which recent discovery led to a new understanding of how genetic mutations increase the risk of cancer? A.) double helix structure of DNA B.) BRCA1 and BRCA2
Which of these story ideas would be considered Gothic writing?
At the bottom of ottoman society were the a. men of the pen. b. men of the sword. c. men of husbandry. d. men of negotiation.
Which of the following atoms would gain two electrons to fill its valence energy level? Ca Br S B
Which of the following was an accomplishment of metallurgists during the Gupta Empire? A the development of the iron plow B the invention of seismographs made
what is the factored form of x2 – 6x – 16? (x – 4)(x – 2) (x 4)(x – 2) (x – 2)(x 8) (x – 8)(x 2)
find the product. (6a b)2 12a2 ab b2 36a2 ab 36b2 36a2 12ab b2 36a2 b2