hello.js

var please = require('share');
console.log('thank you');

Tuesday, 10 July, 2018 UTC

Diving deeper into the Event object. Creating and using custom events

Diving deeper into the Event object. Creating and using custom events

In the previous article, we’ve learned what events are and how to work with them. This time we will dive a bit deeper into them, explaining in more details how do they work. We will go through the event object and create our own, custom events. We will ... more


Monday, 2 July, 2018 UTC

Understanding events. Bubbling and capturing

Understanding events. Bubbling and capturing

JavaScript is a language, where events play a big role. In this article, we will talk about how they work. It includes different ways of listening to them and how they propagate. On the way we will cover some of mechanics from under the hood of JavaScript ... more


Monday, 25 June, 2018 UTC

Understanding memory management and the garbage collector.

Understanding memory management and the garbage collector.

In JavaScript, the memory taken by the values held by the variables is automatically freed when they are not used anymore. This is done by the garbage collector to free up space. How can we benefit from knowing how it works and therefore how to write ... more


Monday, 18 June, 2018 UTC

Cookies: explaining document.cookie and the Set-Cookie header.

Cookies: explaining document.cookie and the Set-Cookie header.

In the previous article, we’ve talked about WebStorage API that you can nowadays use to store data in the browser. LocalStorage and sessionStorage were introduced in the HTML5. Does that mean that before we could not save data on the client side? Not ... more


Monday, 11 June, 2018 UTC

Web Storage API: localStorage and sessionStorage

Web Storage API: localStorage and sessionStorage

Web Storage API is used to store data in the browser and was introduced in HTML5. It brought us localStorage and sessionStorage. At the first glance, they seem similar. There are some important differences between them though, which is what we will talk ... more


Monday, 4 June, 2018 UTC

Code splitting with SplitChunksPlugin in Webpack 4

Code splitting with SplitChunksPlugin in Webpack 4

Webpack 4 brought us some changes. Among things like faster bundling, it introduced SplitChunksPlugin , which made CommonsChunksPlugin obsolete. In this article, you will learn how to split your output code to improve the performance of our application. ... more


Monday, 28 May, 2018 UTC

Diving into functions. Passing by reference is a lie!

Diving into functions. Passing by reference is a lie!

Functions are one of the most basic features of JavaScript. Have you ever wondered how exactly do they work? After all, they are just a special kind of objects. If you are curious, dig into them with me in this article! The basics of functions Speaking ... more


Monday, 21 May, 2018 UTC

Keeping your dependencies in order when using NPM.

Keeping your dependencies in order when using NPM.

Mastering your tools as a developer is a very important thing. One of them is Node Package Manager – and quite a crucial one for a JavaScript developer. Having a better understanding how dependencies work will improve your workflow greatly and help to ... more


Monday, 14 May, 2018 UTC

Regex course – part three. Grouping and using ES6 features.

Regex course – part three. Grouping and using ES6 features.

We covered quite a few features of regex so far. There is a lot more, though. Today we will deal with more advanced concepts, like groping and cover more of the RegExp object features in JavaScript. We will also learn how to use some of the features ... more


Tuesday, 8 May, 2018 UTC

Regex course – part two. Writing more elegant and precise patterns.

Regex course – part two. Writing more elegant and precise patterns.

Hello again! Today we are back to regular expressions in JavaScript. If you are new to them, check out the first part of the course. This time we will learn how to write more elegant patterns and define the position of searched strings. The shorter way ... more


Monday, 30 April, 2018 UTC

Regex course – part one. Basic concepts.

Regex course – part one. Basic concepts.

Regular expressions (regex) are sequences of characters defining a search pattern. Since it can be extremely useful in programmers everyday life, it was implemented into JavaScript. In this series of articles, I will show you how it works and what are ... more


Monday, 23 April, 2018 UTC

Demystifying generators. Implementing async/await.

Demystifying generators. Implementing async/await.

Generators are a new feature introduced in ES6, and as I’ve promised in the article about async/await last week, we will cover them today. Iterators In JavaScript an iterator is an object that provides a next() method which returns the next item in the ... more


Monday, 16 April, 2018 UTC

Explaining async/await. Creating dummy promises.

Explaining async/await. Creating dummy promises.

Back in the days, we used callbacks. Then, we were blessed with promises. The journey does not stop there, though. ES7 introduced us to a new way of handling asynchronous calls: async/await . Feel free to read my other articles if you would like to know ... more


Monday, 9 April, 2018 UTC

Explaining promises and callbacks while implementing a sorting algorithm.

Explaining promises and callbacks while implementing a sorting algorithm.

There is a good chance that you are already using promises in your code – they are everywhere now. Have you ever considered how they work, though? I this article I want to explain why they are a good thing and what problems do they solve. I will do that ... more


Monday, 2 April, 2018 UTC

[1] + [2] – [3] === 9!? Looking into assembly code of coercion.

[1] + [2] – [3] === 9!? Looking into assembly code of coercion.

Variable values have certain types. In fact, you can cast a value of one type to the other. If you do it explicitly, it is type casting (also called explicit coercion ). If it happens in the background when you are trying to perform an operation on types ... more


Monday, 26 March, 2018 UTC

Scopes in JavaScript. Different types of variable declarations.

Scopes in JavaScript. Different types of variable declarations.

You can think of a scope as of a wrapper that contains all the variables and a reference to the parent scope. What does that mean and what should we watch out for when dealing with it? Let’s find out! How scopes work When we try to access a variable ... more


Monday, 19 March, 2018 UTC

Prototype. The big bro behind ES6 class.

Prototype. The big bro behind ES6 class.

One of the great things that ES6 brought us are classes. We need to remember though, that all the work is done by prototypes under the hood. It means that ES6 classes act just as syntactic sugar . In this article, I will walk you through the basics of ... more


Tuesday, 13 March, 2018 UTC

Defining the undefined. A try/catch trick.

Defining the undefined. A try/catch trick.

Undefined is one of the reasons for confusion and can get under the skin of a developer. But what is it exactly? Definition of undefined It is a value undefined value primitive value used when a variable has not been assigned a value Undefined is a special ... more


Monday, 5 March, 2018 UTC

Priority of CSS declarations. A smart way to avoid !important.

Priority of CSS declarations. A smart way to avoid !important.

Have you ever taken a minute to consider how does a css parser handles the priority of all of the css declarations? This might be just the right moment! This knowledge will help you avoid many problems along the way. C stands for Cascading The first ... more


Monday, 26 February, 2018 UTC

What is “this”? Arrow functions.

What is “this”? Arrow functions.

If you ever programmed in another Object Oriented language, “ this” keyword in JavaScript might be very confusing for you. Bear with me, I will show you some Java code. public class Point { int x; int y; public Point(int x, int y){ this.x = x; this.y ... more


Monday, 19 February, 2018 UTC

Current state of compiling TypeScript to WebAssembly

Current state of compiling TypeScript to WebAssembly

WebAssembly (wasm) is an emerging standard – the future is coming. The support in browsers is already growing – what we still need is lowering the entry barrier for us, developers. Luckily, that is soon to be changed. I want to present you with a quick ... more


Monday, 12 February, 2018 UTC

Cloning objects in JavaScript. Looking under the hood of reference and primitive types.

Cloning objects in JavaScript. Looking under the hood of reference and primitive types.

There are two types of clones in JavaScript: deep, and shallow. To fully understand the difference, we need to dive deeper into how the interpreter treats different types of variables. Let’s go! Primitive types null undefined boolean number string symbol ... more


Thursday, 1 February, 2018 UTC

When async is just not enough. An introduction to multithreading in the browser

When async is just not enough. An introduction to multithreading in the browser

First things first: JavaScript code being asynchronous does not implicate it running in more than one thread. So what does asynchronous mean exactly? Imagine making an Ajax request to fetch some data from the server. You won’t get a response immediately ... more


Thursday, 1 February, 2018 UTC

When async is just not enough. An introduction to multithreading in the browser

When async is just not enough. An introduction to multithreading in the browser

First things first: JavaScript code being asynchronous does not implicate it running in more than one thread. So what does asynchronous mean exactly? Imagine making an Ajax request to fetch some data from the server. You won’t get a response immediately ... more