Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion arrayProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

//Add a reverse method to the String 'class' so that every instance of String can call reverse and reverse itself.

//code here
//code here
String.prototype.reverse = function(){
return this.split("").reverse().join("");
}
22 changes: 21 additions & 1 deletion instanceArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,48 @@ var User = function(name, email, pw){
//Create an Array called 'users' that will store all our instances of User.

//code here
let users = [];


//Now create and push into your users array 3 separate instances of User using the data from above in that exact order

//code here

users.push(new User('Aodhan', 'aodhan@boom.camp', 'iLoveJS'));
users.push(new User('Greg', 'greg@boom.camp', 'iLovePython'));
users.push(new User('Oscar', 'oscar@boom.camp', 'iLoveSoccer'));

console.log('Aodhan\'s information is ');
//Console.log all of Aodhan information

//code here
users.map(user=>{
if(user.name === "Aodhan"){
console.log(" Registered Email: " + user.email + " and Registered Password:" + user.pw);
}
});

console.log('Oscar\'s information is ');
//Now console.log all of Oscars information

//code here
users.map(user=>{
if(user.name === "Oscar"){
console.log(" Registered Email: " + user.email + " and Registered Password:" + user.pw);
}
});


//Now create another instance of User using your own information and then add that to your users array.

//code here

users.push(new User('Yow','jeffrey.molleno@boom.camp','thirdwheelingmajor'));
console.log('All my users names are ');
//Now loop through your users Array and console.log every users name.

//code here
users.map(user=>{
if(user.name === "Yow"){
console.log(" Registered Email: " + user.email + " and Registered Password:" + user.pw);
}
});
32 changes: 31 additions & 1 deletion quizApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,45 @@

//code here

function QuizUser(name, email, password, totalScore){
this.name = name;
this.email= email;
this.password = password;
this.totalScore = totalScore;
}


//Create a Question constructor that accepts title, answersArray, rightAnswer, and difficulty parameters

//code here

function Question(title, answersArray, rightAnswer, difficulty){
this.title = title;
this.answersArray = answersArray;
this.rightAnswer = rightAnswer;
this.difficulty = difficulty;
}


//Create a quizUsers Array which is going to hold all of our users.

//code here
var quizUsers = [];


//Let's say three people signed up for our service, create 3 instances of User and add each to the users Array

//code here

quizUsers.push(new QuizUser("Yow", "jeffrey.molleno@boom.camp", "sadlyf", 0 ));
quizUsers.push(new QuizUser("Loki", "loki@boom.camp", "qiqil", 0 ));
quizUsers.push(new QuizUser("Aquila", "Aquila@boom.camp", "sanaall", 0 ));


//Create a questions Array which is going to hold all of our questions

//code here

var questions = [];

//Now, let's say we wanted to create a quiz about JavaScript. Create three instances of Question which contain the following data
//title: 'T/F: Inheritance is achieved in JavaScript through Prototypes?'
Expand All @@ -36,13 +55,24 @@

//code here

let question1 = new Question('T/F: Inheritance is achieved in JavaScript through Prototypes?','True or False','True','Advance');

let question2 = new Question('T/F: JavaScript is just a scripting version of Java','True or False','False','Basic');

let question3 = new Question("T/F: In Javascript, == doesn't check 'type' but just the value - where === checks type and value",'True or False','True','Intermediate');

//Now push all of your instances of Question into the questions Array

//code here
questions.push(question1);
questions.push(question2);
questions.push(question3);

console.log('My users Array and my questions arrray are ...');
//Now loop console.log your users array and your questions array and verify that they're both holding the right data.

//code here

quizUsers.map(user=>console.log(user));

questions.map(ask=>console.log(ask));
13 changes: 11 additions & 2 deletions sayName.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
//Create a Person constructor that accepts name and age as parameters and sets those properties accordingly in the Constructor.

//code here

function Person(name, age){
this.name = name;
this.age = age;
}

//Now create three instances of Person with data you make up

//code here

let beb = new Person("P****","23");
let friend = new Person("Zel","21");
let must_protect = new Person("Jai","3");

//Now add a sayName method on your Person class that will alert the name of whatever Person instance called it.

//code here
Person.prototype.sayName = function(){
alert(this.name);
};

4 changes: 2 additions & 2 deletions user.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "",
"email": ""
"name": "Jeffrey Molleno",
"email": "jeffrey.molleno@boom.camp"
}