By convention, constructor function names should start with an upper case letter as a reminder that they should be called with the ``++new++`` keyword.


A function is considered to be a constructor when it sets all of its arguments as object properties, and returns no value.


== Noncompliant Code Example

----
function person (firstName, middleInitial, lastName) {  // Noncompliant
  this.firstName = firstName;
  this.middleInitial = middleInitial;
  this.lastName = lastName;
}
----


== Compliant Solution

----
function Person (firstName, middleInitial, lastName) {
  this.firstName = firstName;
  this.middleInitial = middleInitial;
  this.lastName = lastName;
}
----


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

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