Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var accountInfo = {
- users: [],
- displayUsers: function () {
- var i;
- for (i = 0; i < this.users.length; i++) {
- console.log(this.users[i]);
- }
- },
- addUser: function(firstName, lastName, gender, age) {
- this.users.push({
- firstName: firstName,
- lastName: lastName,
- gender: gender,
- age: age,
- isVerified: false
- });
- this.displayUsers();
- },
- showVerified: function() {
- var i;
- for (i = 0; i < this.users.length; i++) {
- if (this.users[i].isVerified === true) {
- console.log(this.users[i]);
- }
- }
- },
- verifyUser: function(position) {
- this.users[position].isVerified = true;
- console.log("User Verified");
- this.showVerified();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement