Created
November 8, 2018 18:12
-
-
Save ZephiroRB/4b04c989a55b8cacbaeb544b54086f9b to your computer and use it in GitHub Desktop.
Credits by console javascript
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
class User { | |
constructor(firstName, lastName, email) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.email = email; | |
} | |
print() { | |
console.group("Developer"); | |
console.warn("firstName: ", this.firstName); | |
console.warn("lastName: ", this.lastName); | |
console.warn("email: ", this.email); | |
console.groupEnd(); | |
} | |
} | |
const users = [ | |
new User("Jose Carlos", "Montalvo Mori", "[email protected]") | |
]; | |
users.printAll = function () { | |
console.group("Invespromo Consulting Team"); | |
for (let i = 0; i < this.length; i++) { | |
this[i].print(); | |
} | |
console.groupEnd(); | |
}; | |
users.printAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment