From bac5eeb8992cad62217450d10cc818e4ba8c1591 Mon Sep 17 00:00:00 2001 From: Jay Bobo Date: Tue, 17 Mar 2015 21:28:59 -0400 Subject: [PATCH] jays-solution --- accessing-array-values.js | 2 ++ array-filtering.js | 6 ++++++ arrays.js | 2 ++ for-loop.js | 9 +++++++++ function-arguments.js | 5 +++++ functions.js | 4 ++++ if-statement.js | 1 + introduction.js | 1 + looping-through-arrays.js | 5 +++++ number-to-string.js | 1 + numbers.js | 1 + object-properties.js | 4 ++++ objects.js | 6 ++++++ revising-strings.js | 1 + rounding-numbers.js | 1 + string-length.js | 1 + strings.js | 1 + variables.js | 3 +++ 18 files changed, 54 insertions(+) create mode 100644 accessing-array-values.js create mode 100644 array-filtering.js create mode 100644 arrays.js create mode 100644 for-loop.js create mode 100644 function-arguments.js create mode 100644 functions.js create mode 100644 if-statement.js create mode 100644 introduction.js create mode 100644 looping-through-arrays.js create mode 100644 number-to-string.js create mode 100644 numbers.js create mode 100644 object-properties.js create mode 100644 objects.js create mode 100644 revising-strings.js create mode 100644 rounding-numbers.js create mode 100644 string-length.js create mode 100644 strings.js create mode 100644 variables.js diff --git a/accessing-array-values.js b/accessing-array-values.js new file mode 100644 index 0000000..eb9efc4 --- /dev/null +++ b/accessing-array-values.js @@ -0,0 +1,2 @@ +var food=['apple','pizza','pear']; +console.log(food[1]); diff --git a/array-filtering.js b/array-filtering.js new file mode 100644 index 0000000..e92e741 --- /dev/null +++ b/array-filtering.js @@ -0,0 +1,6 @@ +var numbers = [1,2,3,4,5,6,7,8,9,10]; +var filtered = numbers.filter( + function(n){ + return n % 2 === 0; + }); +console.log(filtered); diff --git a/arrays.js b/arrays.js new file mode 100644 index 0000000..8f0559e --- /dev/null +++ b/arrays.js @@ -0,0 +1,2 @@ +var pizzaToppings = ['tomato sauce', 'cheese', 'pepperoni']; +console.log(pizzaToppings); diff --git a/for-loop.js b/for-loop.js new file mode 100644 index 0000000..d16b898 --- /dev/null +++ b/for-loop.js @@ -0,0 +1,9 @@ +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.');} diff --git a/introduction.js b/introduction.js new file mode 100644 index 0000000..e921523 --- /dev/null +++ b/introduction.js @@ -0,0 +1 @@ +console.log('hello'); diff --git a/looping-through-arrays.js b/looping-through-arrays.js new file mode 100644 index 0000000..b6dfc29 --- /dev/null +++ b/looping-through-arrays.js @@ -0,0 +1,5 @@ +var pets = ['cat','dog','rat']; +for(var i=0; i