JS Fundamentals
Some basic JS examples for forgetful
Folders structure
-
Fundamentals
Very very basic javascript examples:
- shapesFunctions.js: Triangle area with js functions
- film.js: Can you watch a film rated with pg? js conditional statements
- freakom.js: Freak words translator. js string manipulation
- runnerStats.js: Runner stats. js. For loop
- superheroesFight.js: Who wins? While loop
- dates.js: js dates
-
Objets
- objetcs.js: js objects, prototype, class,...
- Intermediate
- this: Who is 'this'?
-
callbacks Asyncronous javascript
- callback: js callbacks
- swapiCallbacks: Using Start Wars API with js callbacks
- swapiPromises: Using Start Wars API with js promises
- swapiAsyncAwait: Using Start Wars API with js async/await
- timeout: Timeout and callback in frontend, manual stopping timeout
- interval: Interval and callback in frontend, manual stopping interval
-
dataAndFunctions js data structures and advanced functions
- fibonacci Fibonacci series: recursive js functions and memoization
- iteratedFibonacci Fibonacci series: iterated (next)
- generatedFibonacci Fibonacci series: generators (yield)
- inmutability mutable vs inmutable: function example
Use
Each file is an executable node script following lasts Ecmascript specification.
Execution example: In order to execute shapeFunctions.js you need to run:
node ./fundamentals/shapeFunctions.js
Transpiled code
You can generate transpiled code by using babel. The codes will be generated under the "lib" folder:
npm run build