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

String.prototype.reverse = function (){
return this.split("").reverse().join("");
}
19 changes: 12 additions & 7 deletions instanceArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,34 @@ var User = function(name, email, pw){

//Create an Array called 'users' that will store all our instances of User.

//code here

var users =new Array();

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

//code here
var Aodhan = new Array('Aodhan', 'aodhan@boom.camp', 'iLoveJS');
var Greg = new Array('Greg', 'greg@boom.camp', 'iLovePython');
var Oscar = new Array('Oscar', 'oscar@boom.camp', 'iLoveSoccer');
users.push(Aodhan);
users.push(Greg);
users.push(Oscar);

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

//code here
console.log(Aodhan);

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

//code here
console.log(Oscar);


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

//code here
var Keanu = new Array('Keanu', 'keanu.manly@boom.camp', 'ilovegames');
users.push(Keanu);

console.log('All my users names are ');
//Now loop through your users Array and console.log every users name.

//code here
console.log(users);
35 changes: 26 additions & 9 deletions quizApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,39 @@

//Create a QuizUser constructor that accepts name, email, password, and totalScore parameters and set them appropriatly

//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 = new Array();


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

//code here

var Aodhan = new Array('Aodhan', 'aodhan@boom.camp', 'iLoveJS',90);
var Greg = new Array('Greg', 'greg@boom.camp', 'iLovePython',90);
var Oscar = new Array('Oscar', 'oscar@boom.camp', 'iLoveSoccer',75);
quizUsers.push(Aodhan); quizUsers.push(Greg); quizUsers.push(Oscar);

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

//code here
var questions = new Array();


//Now, let's say we wanted to create a quiz about JavaScript. Create three instances of Question which contain the following data
Expand All @@ -34,15 +46,20 @@
//title: "T/F: In Javascript, == doesn't check 'type' but just the value - where === checks type and value"
//Fill in the rest of the required data as you see appropriate.

//code here
var quest1 = new Array ('english','Inheritance is achieved in JavaScript through Prototypes?',true,'hard');
var quest2 = new Array ('english','JavaScript is just a scripting version of Java',true,'easy');
var quest3 = new Array ('english','n Javascript, == doesn\'t check \'type\' but just the value - where === checks type and value',true,'hard');


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

//code here
questions.push(quest1);
questions.push(quest2);
questions.push(quest3);

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
console.log(questions);
console.log(quizUsers);

17 changes: 12 additions & 5 deletions sayName.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
//Create a Person constructor that accepts name and age as parameters and sets those properties accordingly in the Constructor.

//code here


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

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

//code here
var Aodhan =new Person('Aodhan',30);
var Greg =new Person('Greg',35);
var Oscar =new Person('Oscar', 33);


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

//code here
Aodhan.sayName();
8 changes: 1 addition & 7 deletions test/spec/arrayPropertySpec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const isNode = new Function(`
try {
return this === global;
} catch (e) {
return false;
}
`);


if (isNode()) {
// test if file is running in a node process
Expand Down
8 changes: 1 addition & 7 deletions test/spec/quizAppSpec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const isNode = new Function(`
try {
return this === global;
} catch (e) {
return false;
}
`);


if (isNode()) {
// test if file is running in a node process
Expand Down
8 changes: 1 addition & 7 deletions test/spec/sayNameSpec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const isNode = new Function(`
try {
return this === global;
} catch (e) {
return false;
}
`);


if (isNode()) {
// test if file is running in a node process
Expand Down
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": "Keanu Ely Gilbert L. Manly",
"email": "keanu.manly@boom.camp"
}