What will be the state stored in d in the following JavaScript code?
var c = counter(), d = counter();
c.count()
d.count()
c.reset()
c.count()
d.count()
a) 1
b) 0
c) null
d) Undefined
Answer: a
Explanation: Counter function increments the value of the variable by 1 and reset function sets the value of the variable back to 0.as d is incremented twice and reset function is not called on d therefore the value of d is 2.
Related Posts
The database environment has all of the following components except:
Related fields in a database are grouped to form a
A logical schema
The language used in application programs to request data from the DBMS is referred to as the
NULL is
In case of entity integrity, the primary key may be
In an E-R diagram attributes are represented by
Join The Discussion