diff --git a/problems/accessing-array-values/accessing-array-values.js b/problems/accessing-array-values/accessing-array-values.js new file mode 100644 index 00000000..4364704a --- /dev/null +++ b/problems/accessing-array-values/accessing-array-values.js @@ -0,0 +1,3 @@ +const food = ['apple', 'pizza', 'pear'] + +console.log(food[2]); \ No newline at end of file diff --git a/problems/array-filtering/array-filtering.js b/problems/array-filtering/array-filtering.js new file mode 100644 index 00000000..b1acddbf --- /dev/null +++ b/problems/array-filtering/array-filtering.js @@ -0,0 +1,7 @@ +const numbers =[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + +const filtered = numbers.filter(function evenNumbers (number) { + return number % 2 === 0 +}); + +console.log(filtered); \ No newline at end of file diff --git a/problems/arrays/arrays.js b/problems/arrays/arrays.js new file mode 100644 index 00000000..28b5cc20 --- /dev/null +++ b/problems/arrays/arrays.js @@ -0,0 +1,3 @@ +const pizzaToppings =["tomato sauce", "cheese", "pepperoni"] + +console.log(pizzaToppings); \ No newline at end of file diff --git a/problems/for-loop/for-loop.js b/problems/for-loop/for-loop.js new file mode 100644 index 00000000..334bbf5c --- /dev/null +++ b/problems/for-loop/for-loop.js @@ -0,0 +1,11 @@ + var total = 0; + var limit = 10; + +for (let i = 0;i < 10; i++ ) { + console.log(total); + +}; + + + + diff --git a/problems/function-arguments/function-arguments.js b/problems/function-arguments/function-arguments.js new file mode 100644 index 00000000..16e9e075 --- /dev/null +++ b/problems/function-arguments/function-arguments.js @@ -0,0 +1,7 @@ +function math (a,b,c) { + + return (b*c+a) + +}; + +console.log(math(53,61,67)); \ No newline at end of file diff --git a/problems/functions/functions.js b/problems/functions/functions.js new file mode 100644 index 00000000..4730f150 --- /dev/null +++ b/problems/functions/functions.js @@ -0,0 +1,14 @@ +function eat (food) { + + return ( + food + ` tasted really good ` + ) + + +}; + console.log(eat ("banana")); + + // question "food"// + + + diff --git a/problems/if-statement/if-statement.js b/problems/if-statement/if-statement.js new file mode 100644 index 00000000..4fe0e7e0 --- /dev/null +++ b/problems/if-statement/if-statement.js @@ -0,0 +1,17 @@ +let fruit = "orange" + +if ("orange" > 5) { + console.log('The fruit name has more than five characters.') +} +else + { + console.log('The fruit name has five characters or less.') +} + + +/*if ("orange" > 5) { + console.log('The fruit name has more than five characters.') +} +else ("orange" <= 5) { + console.log('The fruit name has five characters or less.') +} can't it be written like this?*/ \ No newline at end of file diff --git a/problems/if-statement/introduction.js b/problems/if-statement/introduction.js new file mode 100644 index 00000000..e69de29b diff --git a/problems/introduction/introduction .js b/problems/introduction/introduction .js new file mode 100644 index 00000000..00b09eaf --- /dev/null +++ b/problems/introduction/introduction .js @@ -0,0 +1 @@ +//I don't understand. \ No newline at end of file diff --git a/problems/looping-through-arrays/looping-through-arrays.js b/problems/looping-through-arrays/looping-through-arrays.js new file mode 100644 index 00000000..59924a2a --- /dev/null +++ b/problems/looping-through-arrays/looping-through-arrays.js @@ -0,0 +1,6 @@ +let pets = ['cat', 'dog', 'rat'] +pets[i] = pets[i] + 's' + +console.log(pets); + +// not working! \ No newline at end of file diff --git a/problems/number-to-string/number-to-string.js b/problems/number-to-string/number-to-string.js new file mode 100644 index 00000000..9688ebed --- /dev/null +++ b/problems/number-to-string/number-to-string.js @@ -0,0 +1,4 @@ +let n = 128 +n = n.toString() + +console.log(n); \ No newline at end of file diff --git a/problems/objects/objects.js b/problems/objects/objects.js new file mode 100644 index 00000000..d27832f9 --- /dev/null +++ b/problems/objects/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/problems/revising-strings/revising-strings.js b/problems/revising-strings/revising-strings.js new file mode 100644 index 00000000..9926e1cc --- /dev/null +++ b/problems/revising-strings/revising-strings.js @@ -0,0 +1,4 @@ +let pizza = 'pizza is alright' +pizza = pizza.replace("alright","wonderful") + +console.log(pizza); \ No newline at end of file diff --git a/problems/rounding-numbers/rounding-numbers.js b/problems/rounding-numbers/rounding-numbers.js new file mode 100644 index 00000000..21a672ad --- /dev/null +++ b/problems/rounding-numbers/rounding-numbers.js @@ -0,0 +1,6 @@ +let roundUp = 1.5 + roundUp = Math.round(1.5) + +let rounded = Math.round(1.5) + +console.log(rounded); \ No newline at end of file diff --git a/problems/scope/scope.js b/problems/scope/scope.js new file mode 100644 index 00000000..b6e9dce4 --- /dev/null +++ b/problems/scope/scope.js @@ -0,0 +1,18 @@ +const a = 1; const b = 2; const c = 3; + +(function firstFunction () { + const b = 5; const c = 6; + + (function secondFunction () { + const b = 8; + + (function thirdFunction () { + const a = 7; const c = 9; + + (function fourthFunction () { + const a = 1; const c = 8; + })() + })() // no entiendo// + })() +})() + diff --git a/problems/string-length/string-length.js b/problems/string-length/string-length.js new file mode 100644 index 00000000..96375396 --- /dev/null +++ b/problems/string-length/string-length.js @@ -0,0 +1,3 @@ +const example = 'example string'; + +console.log(example.length); \ No newline at end of file diff --git a/problems/strings/strings.js b/problems/strings/strings.js new file mode 100644 index 00000000..1b8827c1 --- /dev/null +++ b/problems/strings/strings.js @@ -0,0 +1,3 @@ +const someString = 'this is a string'; + +console.log(someString); \ No newline at end of file diff --git a/problems/variables/variables.js b/problems/variables/variables.js new file mode 100644 index 00000000..0d87ec7b --- /dev/null +++ b/problems/variables/variables.js @@ -0,0 +1,3 @@ +let example = 'some string'; + +console.log(example); \ No newline at end of file