Skip to content

Commit 48a2507

Browse files
committed
Added solutions and README.md modified
1 parent 0cf05f8 commit 48a2507

17 files changed

+70
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,24 @@ Use console.log() to print the types property of the food object to the terminal
122122

123123
#### Exercise Fourteen
124124

125+
Create a javascript file. In that file, define a variable named food like this:
126+
127+
var food = {
128+
types: 'only pizza'
129+
};
130+
131+
Use console.log() to print the types property of the food object to the terminal.
132+
133+
#### Exercise Fifteen
134+
125135
Create a javascript file. In that file, define a function named eat that takes an argument named food
126136
that is expected to be a string. Inside the function return the food argument like this:
127137

128138
return food + ' tasted really good.';
129139

130140
Inside of the parentheses of console.log(), call the eat() function with the string bananas as the argument.
131141

132-
#### Exercise Fifteen
142+
#### Exercise Sixteen
133143

134144
Create a javascript file. In that file, define a function named math that takes three arguments. It's important for you to understand that arguments names are only used to reference them.
135145

solutions/exerciseEight.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var fruit = 'orange';
2+
if(fruit.length > 5) {
3+
console.log('The fruit name has more than five characters.');
4+
}
5+
else {
6+
console.log('The fruit name has five characters or less.');
7+
}

solutions/exerciseEleven.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var numbers = [1,2,3,4,5,6,7,8,9,10];
2+
var filtered = numbers.filter(function evenNumbers(number){
3+
return number % 2 === 0;
4+
});
5+
console.log(filtered);

solutions/exerciseFifteen.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function eat(food){
2+
return food + ' tasted really good.';
3+
}
4+
console.log(eat('bananas'));

solutions/exerciseFive.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var example = 123456789;
2+
console.log(example);

solutions/exerciseFour.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var pizza = 'pizza is alright';
2+
pizza = pizza.replace('alright','wonderful');
3+
console.log(pizza);

solutions/exerciseFourteen.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var food = {
2+
types: 'only pizza'
3+
}
4+
console.log(food.types);

solutions/exerciseNine.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var total = 0;
2+
var limit = 10;
3+
for(var i = 0; i < limit; i++) {
4+
total += i;
5+
}
6+
console.log(total);

solutions/exerciseOne.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var example = 'some string';
2+
console.log(example);

solutions/exerciseSeven.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var n = 128;
2+
console.log(n.toString());

0 commit comments

Comments
 (0)