Currently, I’m going through freeCodeCamp’s new learning curriculum. I just finished the first part, which was the Responsive Web Design Certification course.
While going through said course, I took notes on the following:
CSS Grid
CSS Flexbox
I also made several responsive web design projects as part of the course.
The second part of the freeCodeCamp curriculum was the Javascript Algorithms And Data Structures Certification course. The following is a list of all the notes I took while going through said course:
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Aqui na Liferay, alguns dias atrás, necessitávamos utilizar o pacote p-map. Só tinha um problema: esta aplicação em específico utilizava módulos no padrão CommonJS, e p-map utiliza módulos ES6. Até algumas das melhores referências que encontrei (por exemplo, este post) deixavam claro que não seria possível importar módulos ES6 a partir de CommonJS.
A boa notícia é que isto não é mais verdade!…
You already know a lot about JS, we hope thanks to our blog as well, so it would be useful to be updated about the ES2018 new features. The ninth edition of the ECMAScript standard, officially known as ECMAScript 2018 (or ES2018 for short), was released in June 2018. Starting with ES2016, new ...
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Creating Simple Range Slider Component Using JavaScript
Creating Simple Range Slider Component Using JavaScript
Writing components is little bit difficult task while developing a web based application, specially when you are a beginner or you don’t know how to write it and implement it.
So lets see how we can create a simple Range Slider component using HTML/CSS/JavaScript.
Before writing JavaScript for component, first we will need a HTML Page. Also we will need a style.css to style the page and script.js…
Through this small article, we are going to overview arrow functions and higher order functions in JavaScript.
Arrow functions
In JavaScript, arrow functions were introduced by ECMAScript 6 and are, in a way, a shorter manner to write functions. They allow us to write functions that are small, inline and single-purpose. They have a concise syntax, implicit returns and share lexical "this" with the parent scope.
Arrow functions allow us to do something like this:
//*************************************// //***** NOT USING ARROW FUNCTIONS *****// //*************************************// var sayHello = function() { console.log('Hello world!'); } var splitePhrase = function(phrase) { return phrase.split(' '); } var multiply = function(x, y) { return x * y; } var setObject = function setProperties(id, name) { return { id: id, name: name }; }; //*********************************// //***** USING ARROW FUNCTIONS *****// //*********************************// let sayHello = () => { console.log('Hello world!'); } let splitePhrase = phrase => phrase.split(' '); let multiply = (x, y) => x * y; let setObject = (id, name) => ({id: id, name: name});
The side effect of arrow functions is, because they are anonymous, even if we place them in variables, they will not give us very good stack traces. The other thing is we can not use them as constructors because they don’t have a prototype property or other internal methods.
Higher order functions
A higher-order function is a function that can take another function as an argument, or that returns a function as a result. The fact that we can place a function into another function allows us to compose small functions into bigger functions. The function passed to the other function is also known as callback. Let's have some examples:
Filter
The filter function returns an array filled with all elements of a provided array that had passed a specific test.
Now, let's try to put all this information together. For some reasons, let's say we are working on a brand new video game where some Italian plumbers have to rescue a princess from a dangerous dragon monster that breathes fire (any resemblance to fictional famous characters is purely coincidental).
Down bellow, we have an array with some events concerning the big monster:
If we want to know how much damage the big monster made on the Italian Plumber 1 at the end of all of these events, using what we previously saw, we can simply do it like this:
That's it! That is how we can use arrow functions and higher order functions to easily have access to some results that would require more lines of code without these last functions.