Last active
February 26, 2020 01:38
-
-
Save jwulf/7519be8323bb62aa39e2256f41fcfe9a to your computer and use it in GitHub Desktop.
A code sample from the article: https://www.joshwulf.com/blog/2020/02/providing-a-semantic-api/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//global variable | |
const GlobalMembersArray =[]; | |
/** | |
* This creates a new Member. | |
* @class | |
* @classdesc A Member object. | |
* @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