diff --git a/accessing-array-values.js b/accessing-array-values.js new file mode 100644 index 0000000..36a8930 --- /dev/null +++ b/accessing-array-values.js @@ -0,0 +1,2 @@ +const food = ['apple', 'pizza', 'pear']; +console.log(food[1]); \ No newline at end of file diff --git a/array-filtering.js b/array-filtering.js new file mode 100644 index 0000000..1dfac94 --- /dev/null +++ b/array-filtering.js @@ -0,0 +1,3 @@ +var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +var filtered = numbers.filter(number=>{return number % 2 === 0}); +console.log(filtered); \ No newline at end of file diff --git a/arrays.js b/arrays.js new file mode 100644 index 0000000..9eb1ab2 --- /dev/null +++ b/arrays.js @@ -0,0 +1,2 @@ +var pizzaToppings = ['tomato sauce', 'cheese', 'pepperoni']; +console.log(pizzaToppings); \ No newline at end of file diff --git a/for-loop.js b/for-loop.js new file mode 100644 index 0000000..1d6805c --- /dev/null +++ b/for-loop.js @@ -0,0 +1,6 @@ +var total = 0; +var limit = 10; +for (var i=0; i5){ + 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/introduction.js b/introduction.js new file mode 100644 index 0000000..ea17b22 --- /dev/null +++ b/introduction.js @@ -0,0 +1 @@ +console.log('hello'); \ No newline at end of file diff --git a/looping-through-arrays.js b/looping-through-arrays.js new file mode 100644 index 0000000..395fa71 --- /dev/null +++ b/looping-through-arrays.js @@ -0,0 +1,5 @@ +var pets = ['cat', 'dog', 'rat']; +for (var i=0; i