-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb55b82
commit 77cbe1d
Showing
15 changed files
with
84 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var foodsArray = ['apple', 'pizza', 'pear']; | ||
console.log(foodsArray[1]); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var numbersArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | ||
var filteredArray = numbersArray.filter(function isEven(element) { | ||
return (element % 2) === 0; | ||
}); | ||
console.log(filteredArray); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var pizzaToppingsArray = ['tomato sauce','cheese','pepperoni']; | ||
console.log(pizzaToppingsArray); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var total = 0 ,limit = 10; | ||
for (var i = 0; i < limit; i++) { | ||
|
||
total+=i; | ||
|
||
} | ||
console.log(total); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var fruit = 'orange'; | ||
var fruitNameLength = fruit.length; | ||
if (fruitNameLength > 1) { | ||
console.log('The fruit name has more than five characters.'); | ||
} | ||
else { | ||
console.log('The fruit name has five characters or less.'); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function math(number1, number2, number3) { | ||
return (number2 * number3) + number1; | ||
} | ||
console.log(math(53, 61, 67)); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function eat(food) { | ||
return food + ' tasted really good.';; | ||
} | ||
console.log(eat('bananas')); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var petsArray = ['cat', 'dog', 'rat']; | ||
for (var i = 0; i < petsArray.length; i++) { | ||
petsArray[i] = petsArray[i] + 's'; | ||
} | ||
console.log(petsArray); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var demoNum = 128; | ||
demoNumString = demoNum.toString(); | ||
console.log(demoNumString); | ||
var numToStringLength = demoNumString.length; | ||
//console.log(numToStringLength); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
var example = 123456789; | ||
console.log(example); | ||
var demoNum = 123456789; | ||
console.log(demoNum); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var foodObject = { | ||
types: 'only pizza' | ||
}; | ||
console.log(foodObject.types); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// var pizzaObject = { | ||
// toppingsArray: ['cheese', 'sauce', 'pepperoni'], | ||
// crustString: 'deep dish', | ||
// servesCount: 2 | ||
// }; | ||
|
||
var pizzaObject = { | ||
toppings: ['cheese', 'sauce', 'pepperoni'], | ||
crust: 'deep dish', | ||
serves: 2 | ||
}; | ||
console.log(pizzaObject); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var example = 'pasta is wonderful'; | ||
example = example.replace('pasta', 'pizza'); | ||
console.log(example); | ||
var stringReplace = 'pasta is wonderful'; | ||
stringReplace = stringReplace.replace('pasta','pizza'); | ||
console.log(stringReplace); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var roundUp=1.5; | ||
roundUp=Math.round(roundUp); | ||
console.log(roundUp); | ||
var roundUp = 1.5; | ||
roundUpNum = Math.round(roundUp); | ||
console.log(roundUpNum); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var a = 1, b = 2, c = 3; | ||
|
||
(function firstFunction(){ | ||
var b = 5, c = 6; | ||
|
||
(function secondFunction(){ | ||
var b = 8; | ||
console.log("a: "+a+", b: "+b+", c: "+c); | ||
(function thirdFunction(){ | ||
var a = 7, c = 9; | ||
|
||
(function fourthFunction(){ | ||
var a = 1, c = 8; | ||
|
||
})(); | ||
})(); | ||
})(); | ||
})(); |