diff --git a/javascripting/accessing-array-values.js b/javascripting/accessing-array-values.js new file mode 100644 index 0000000..d4da011 --- /dev/null +++ b/javascripting/accessing-array-values.js @@ -0,0 +1,2 @@ +var food = ['apple', 'pizza', 'pear']; +console.log(food[1]) \ No newline at end of file diff --git a/javascripting/array-filtering.js b/javascripting/array-filtering.js new file mode 100644 index 0000000..71433a3 --- /dev/null +++ b/javascripting/array-filtering.js @@ -0,0 +1,6 @@ +var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +var filtered = numbers.filter(function evenNumbers(number){ + return number %2 === 0; +}) + +console.log(filtered) \ No newline at end of file diff --git a/javascripting/arrays.js b/javascripting/arrays.js new file mode 100644 index 0000000..fb8f81d --- /dev/null +++ b/javascripting/arrays.js @@ -0,0 +1,2 @@ +var pizzaToppings = ['tomato sauce', 'cheese', 'pepperoni'] +console.log(pizzaToppings) \ No newline at end of file diff --git a/javascripting/for-loop.js b/javascripting/for-loop.js new file mode 100644 index 0000000..6e2a91c --- /dev/null +++ b/javascripting/for-loop.js @@ -0,0 +1,6 @@ +var total = 0 +limit = 10 +for(var i = 0; i 5){ + console.log("The fruit name has more than five characters.") +} +else{ + console.log("The fruit name has five characters or less.") +} \ No newline at end of file diff --git a/javascripting/introduction.js b/javascripting/introduction.js new file mode 100644 index 0000000..ea17b22 --- /dev/null +++ b/javascripting/introduction.js @@ -0,0 +1 @@ +console.log('hello'); \ No newline at end of file diff --git a/javascripting/looping-through-arrays.js b/javascripting/looping-through-arrays.js new file mode 100644 index 0000000..bb1814e --- /dev/null +++ b/javascripting/looping-through-arrays.js @@ -0,0 +1,5 @@ +var pets = ['cat', 'dog', 'rat']; +for(var i = 0; i