When an object method is assigned to a variable, it is most likely a mistake: the parentheses have been left off the method invocation. When this is actually done on purpose, it will llikely yield unpredictable results since the method will have been designed to work in a different scope (the scope of the object) than it will execute in (the global scope).


== Noncompliant Code Example

----
var person = new Person("John", "Doe");
var age = person.getAge;  // Noncompliant; will likely return NaN
----


== Compliant Solution

----
var person = new Person("John", "Doe");
var age = person.getAge();
----


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
