diff --git a/README.md b/README.md index c9c8fd3a..d78de6e4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # JAVASCRIPTING -> Learn JavaScript by adventuring around in the terminal. +> Learn JavaScript by adventuring around in the terminal. > _Looking for more interactive tutorials like this? Go to [nodeschool.io](http://nodeschool.io)._ ## Get help + Having issues with javascripting? Get help troubleshooting in the [nodeschool discussions repo](https://github.com/nodeschool/discussions), on [gitter](https://gitter.im/nodeschool/discussions) or in [repository issues](https://github.com/workshopper/javascripting/issues) @@ -38,7 +39,7 @@ You'll see the menu: ![javascripting screenshot](screenshot.png) -Navigate the menu with the up & down arrow keys. +Navigate the menu with the up & down arrow keys. Choose a challenge by hitting enter. @@ -46,9 +47,9 @@ Choose a challenge by hitting enter. ![first challenge](javascripting.gif) -In the gif I'm using the command line editor `nano` ([here are some basic usage tips for nano](https://github.com/sethvincent/dev-envs-book/blob/master/chapters/05-editors.md#nano)). +In the gif I'm using the command line editor `nano` ([here are some basic usage tips for nano](https://github.com/sethvincent/dev-envs-book/blob/master/chapters/05-editors.md#nano)). -You can use any editor you like. +You can use any editor you like. [atom](http://atom.io) or [brackets](http://brackets.io/) are both good options. diff --git a/functions.js b/functions.js new file mode 100644 index 00000000..e69de29b diff --git a/javascripting/accessing-array-values.js b/javascripting/accessing-array-values.js new file mode 100644 index 00000000..ecf69d4a --- /dev/null +++ b/javascripting/accessing-array-values.js @@ -0,0 +1,5 @@ +const food = ['apple', 'pizza', 'pear'] +console.log(food[1]) + + + diff --git a/javascripting/array-filtering.js b/javascripting/array-filtering.js new file mode 100644 index 00000000..2f36df2a --- /dev/null +++ b/javascripting/array-filtering.js @@ -0,0 +1,8 @@ + +const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +const filtered = numbers.filter(function (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 00000000..12c92f2d --- /dev/null +++ b/javascripting/arrays.js @@ -0,0 +1,2 @@ +const 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 00000000..a2e9a4a8 --- /dev/null +++ b/javascripting/for-loop.js @@ -0,0 +1,9 @@ + +let total = 0 +const limit = 10 + +for (let i = 0; i < limit; i++) { + total += i +} + +console.log(total) \ No newline at end of file diff --git a/javascripting/function-arguments.js b/javascripting/function-arguments.js new file mode 100644 index 00000000..dcd58fee --- /dev/null +++ b/javascripting/function-arguments.js @@ -0,0 +1,4 @@ +function math(a, b, c) { + return (b * c) + a +} +console.log(math(53, 61, 67)); \ No newline at end of file diff --git a/javascripting/functions.js b/javascripting/functions.js new file mode 100644 index 00000000..e41fef64 --- /dev/null +++ b/javascripting/functions.js @@ -0,0 +1,5 @@ +function eat(food) { + return food + ' tasted really good.' +} + +console.log(eat('bananas')) \ No newline at end of file diff --git a/javascripting/if-statement.js b/javascripting/if-statement.js new file mode 100644 index 00000000..46eb4018 --- /dev/null +++ b/javascripting/if-statement.js @@ -0,0 +1,9 @@ +var fruit = "orange"; + +if (fruit.length > 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 00000000..d690bf28 --- /dev/null +++ b/javascripting/introduction.js @@ -0,0 +1,2 @@ + +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 00000000..43587a79 --- /dev/null +++ b/javascripting/looping-through-arrays.js @@ -0,0 +1,10 @@ +const pets = ['cat', 'dog', 'rat'] + +// we are putting a s in the end of each animal in the array +for (let i = 0; i < pets.length; i++) { + pets[i] = pets[i] + 's' +} + +console.log(pets) + + diff --git a/javascripting/number-to-string.js b/javascripting/number-to-string.js new file mode 100644 index 00000000..b4a608ff --- /dev/null +++ b/javascripting/number-to-string.js @@ -0,0 +1,2 @@ +const n = 128 +console.log(n.toString()) \ No newline at end of file diff --git a/javascripting/numbers.js b/javascripting/numbers.js new file mode 100644 index 00000000..ab88fc0e --- /dev/null +++ b/javascripting/numbers.js @@ -0,0 +1,2 @@ +var example = 123456789 +console.log(example); \ No newline at end of file diff --git a/javascripting/object-keys.js b/javascripting/object-keys.js new file mode 100644 index 00000000..2bf20d71 --- /dev/null +++ b/javascripting/object-keys.js @@ -0,0 +1,11 @@ +const car = { + make: 'Honda', + model: 'Accord', + year: 2020 +} + +// this is to get the make: model: and also year not the result , thats what object does +const keys = Object.keys(car) + +console.log(keys); + diff --git a/javascripting/object-properties.js b/javascripting/object-properties.js new file mode 100644 index 00000000..6f986596 --- /dev/null +++ b/javascripting/object-properties.js @@ -0,0 +1,5 @@ +const food = { + types: 'only pizza' +} + +console.log(food.types); diff --git a/javascripting/objects.js b/javascripting/objects.js new file mode 100644 index 00000000..decc6a68 --- /dev/null +++ b/javascripting/objects.js @@ -0,0 +1,7 @@ + +const pizza = { + toppings: ['cheese', 'sauce', 'pepperoni'], + crust: 'deep dish', + serves: 2 +} +console.log(pizza) \ No newline at end of file diff --git a/javascripting/revising-strings.js b/javascripting/revising-strings.js new file mode 100644 index 00000000..704f7671 --- /dev/null +++ b/javascripting/revising-strings.js @@ -0,0 +1,5 @@ + +let pizza = 'pizza is alright' +pizza = pizza.replace('alright', 'wonderful') + +console.log(pizza); \ No newline at end of file diff --git a/javascripting/rounding-numbers.js b/javascripting/rounding-numbers.js new file mode 100644 index 00000000..b8525e80 --- /dev/null +++ b/javascripting/rounding-numbers.js @@ -0,0 +1,3 @@ +const roundUp = 1.5 +const rounded = Math.round(roundUp) +console.log(rounded) diff --git a/javascripting/string-length.js b/javascripting/string-length.js new file mode 100644 index 00000000..16ffff88 --- /dev/null +++ b/javascripting/string-length.js @@ -0,0 +1,2 @@ +const example = 'example string' +console.log(example.length); \ No newline at end of file diff --git a/javascripting/strings.js b/javascripting/strings.js new file mode 100644 index 00000000..4e8fe37c --- /dev/null +++ b/javascripting/strings.js @@ -0,0 +1,2 @@ +const someString = 'this is a string' +console.log(someString) \ No newline at end of file diff --git a/javascripting/variables.js b/javascripting/variables.js new file mode 100644 index 00000000..ac1b6042 --- /dev/null +++ b/javascripting/variables.js @@ -0,0 +1,2 @@ +const example = 'some string' +console.log(example) \ No newline at end of file