Skip to content

Instantly share code, notes, and snippets.

@jwulf
Last active February 26, 2020 01:37
Show Gist options
  • Save jwulf/0ca50dcd0b19aa0b6ae77ca76f7528df to your computer and use it in GitHub Desktop.
Save jwulf/0ca50dcd0b19aa0b6ae77ca76f7528df to your computer and use it in GitHub Desktop.
//global variable
const GlobalMembersArray =[];
/**
* Member type definition
* @typedef {Object} Member
* @property {string} id - The unique id of the member.
* @property {string} password - The member's password.
*/
/**
* This creates a new Member.
* @constructs Member
* @param {Object} memberData - The data for the member to create.
* @param {string} memberData.id - The unique id of the member.
* @param {string} memberData.password - The member's password.
*/
function Member({id, password}){
this.id = id;
this.password = password
}
const member1 = new Member({id: "m001", password: "123"});
GlobalMembersArray.push(member1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment