From 121b1700da103c9470ceb91f83cc4240c535bf31 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 21 Aug 2022 01:28:53 +0200 Subject: [PATCH] Start working the exercise --- solutions/day-01/30DaysOfJS/index.html | 12 ++++++++++++ solutions/day-01/level1.js | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 solutions/day-01/30DaysOfJS/index.html create mode 100644 solutions/day-01/level1.js diff --git a/solutions/day-01/30DaysOfJS/index.html b/solutions/day-01/30DaysOfJS/index.html new file mode 100644 index 0000000..68f3f4b --- /dev/null +++ b/solutions/day-01/30DaysOfJS/index.html @@ -0,0 +1,12 @@ + + + + 30DaysOfScript:Internal Script + + + + + + \ No newline at end of file diff --git a/solutions/day-01/level1.js b/solutions/day-01/level1.js new file mode 100644 index 0000000..96fc427 --- /dev/null +++ b/solutions/day-01/level1.js @@ -0,0 +1,13 @@ +const array = []; +const arraOfNumbers = [1, 2, 3, 4, 5, 6]; +let lengtharraOfNumbers = arraOfNumbers.length; +const firstItem = arraOfNumbers[0]; +//Get the first item, +console.log(firstItem); +console.log(lengtharraOfNumbers); +//Get the middle item +let middleItem = lengtharraOfNumbers / 2; +console.log(middleItem); +//Get the last item +const [lastItem] = arraOfNumbers.slice(-1); +console.log(lastItem); \ No newline at end of file