#30daysofjavascript — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #30daysofjavascript, aggregated by home.social.
-
#Day36 : Promises and Async/Await Exercices from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Promises-and-AsyncAwait-Exercices-Day36-of-100DaysOfCode
Learned :
- Promises are based on `resolve and reject`, if it `resolves` the `.then` executes, if it `rejects` we `.catch` the error
- `Async/Await` : `async` make the function a promise, two blocks similar as `resolve` and `reject` : `try` and `catch`#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #LearnJavascript #JS
-
#Day35 : #JSON Exercices from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/JSON-Exercices-Day35-of-100DaysOfCode
Learning :
- basic JSON structure : double quotes
- change JSON to object with JSON.parse(const, (key, value))
- change something JS in JSON with JSON.stringify(obj, replacer, space)#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #LearnJavascript #JS
-
#Day34 : Destructuring & Spreading Exercices from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Destructuring-and-Spreading-Exercice-Day33-of-100DaysOfCode
Learning :
- destructuring arrays and objects
- destructuring in for... of loop
partial destructuring with , ,
- structuredClone() to create non superficial copies of objects
- complex treatments in array nested in object#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #LearnJavascript #JS
-
#Day33 :Classes Exercices from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Classes-Exercice-Day34-of-100DaysOfCode/tree/main
Learning :
- class allows to create an object with built in properties
- class `constructor` is the better way to add properties
- this
- class extending to create child objects of the class that herits properties
- `constructor` and `super` to rewrite or add properties to the child class#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #LearnJavascript #JS
-
#Day32 : Sets and Maps Exercices from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Sets-and-Maps-Exercices-Day32-Of-100DaysOfCode
- `Set` to get unique elements from an array
- `Map` to organize array in objects using as we want keys
- find unique values in a big array combinating `map` array method, flattening and `Set`#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #LearnJavascript #JS
-
#Day31 : Higher Order Functions Exercices from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Higher-Order-Functions-Exercices-Day31-Of-100DaysOfCode
- concatenate strings with reduce
- some, every array method
-populating an object : using a combination of storing object, for...of loop, sort, slice, map
-create object with bracket notation storingObject[key] = value#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #LearnJavascript #JS
-
#Day30 : Object Exercices from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Object-Exercices-Day30-Of-100DaysOfCode
- using for in loops and understanding that it requireds the [index] of the item
- using .every() array method that return a true or false
- structuredClone() to deep copy an object
using Object.keys, Object.values, Object.entries and array destructuring
.find() array method
#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #LearnJavascript #JS
-
#Day29 : Loop Exercices part III from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Loop-Exercices-III-Day29-of-100DaysOfCode
- reminded filter and map array methods
used for...of, forEach loops
- copied an array to avoid mutation
- push into an array if a condition is met#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #CodingDay #FrontendDevelopment #CodingChallenge #LearnCode #WebDevelopment #LearnJavascript #JS
-
#Day28 : Array Exercices part III from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Array-Methods-Exercices-III-Day28-of-100DaysOfCode
- array destructuring with... in order to use Math.min() and Math.max() (because they only works on numbers and not on an array)
- reduce in order to calculate a sum of elements necessary to an average
#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #CodingDay #FrontendDevelopment #CodingChallenge #LearnCode #WebDevelopment #LearnJavascript #JS -
#Day27 : Loop Exercices part II from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Loop-Exercices-II-Day27-of-100DaysOfCode
- understood why it's necessary to put return in map array method
- array of arrays thanks to map and []
- reduce to combine to subArray to a string#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #CodingDay #FrontendDevelopment #CodingChallenge #LearnCode #WebDevelopment #LearnJavascript #JS
-
#Day26 : Array Methods partII from #30DaysOfJavascript
Source Code : https://github.com/teotimepacreau/Array-Methods-Exercices-II-Day26-of-100DaysOfCode
- import and export arrays from separate files
- replace string method to - remove string elements
- split string method to put each element in an array
- filter out one element of an array
- sort ascendantly
#WebDev #Frontend #WebDesign #LearnWebDev #Javascript #LearnToCode #CodingDay #FrontendDevelopment #CodingChallenge #LearnCode #WebDevelopment #LearnJavascript #JS