17 expected_completing_date,
18 initiated_organization,
19 communityUID,
20 initiativeUID = false,21 projectID
22 ) {
23 // Call the parent constructor with required parameters
14 * @param {string} description - Description of the group
15 * @param {string} projectID - ID of the project the group is associated with
16 */
17 constructor (members = [], name, description, projectID, groupID) {18 super(projectID) // Call the super class constructor and pass in the projectID
19 this.projectID = projectID
20 this.db = new Firestore('chatGroups', groupID)
17 constructor (
18 name,
19 organizations = [],
20 volunteers = [],21 started_date,
22 expected_completing_date,
23 initiated_organization,
16 */
17 constructor (
18 name,
19 organizations = [],20 volunteers = [],
21 started_date,
22 expected_completing_date,
Putting default parameter at last allows function calls to omit optional tail arguments.
// Correct: optional argument can be omitted
function createUser(id, isAdmin = false) {}
createUser("tabby")
// Incorrect: optional argument can **not** be omitted
function createUser(isAdmin = false, id) {}
createUser(undefined, "tabby")
function f(a = 0, b) {}
function f(a, b = 0, c) {}
function f(a, b = 0) {}