hello.js

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

Monday, 17 September, 2018 UTC

JavaScript testing tutorial – part four. Mocking API calls and simulating React components interactions

JavaScript testing tutorial – part four. Mocking API calls and simulating React components interactions

Today we test our React components further. It involves simulating component interactions and mocking the API calls. You will learn how to do both, so let’s go! Mocking A common thing is for our application to fetch some data from the API. A problem ... more


Monday, 10 September, 2018 UTC

JavaScript testing tutorial – part three. Testing props, the mount function and snapshot tests.

JavaScript testing tutorial – part three. Testing props, the mount function and snapshot tests.

Hello! In the previous part of the tutorial, we’ve covered the very basics of testing React components with Enzyme. Today we will dig a bit deeper and learn how to test props, how (and why) use the mount function and what are the snapshot tests. Let’s ... more


Monday, 3 September, 2018 UTC

JavaScript testing tutorial – part two. Introducing Enzyme and testing React components

JavaScript testing tutorial – part two. Introducing Enzyme and testing React components

At the previous part of the tutorial, we’ve briefly covered the basics of unit testing. This time we will go further and start testing React with the Enzyme library. Thanks to the that, your application will be more reliable and it will be easier to ... more


Monday, 27 August, 2018 UTC

JavaScript testing tutorial – part one. Explaining types of tests. Basics of unit testing with Jest

JavaScript testing tutorial – part one. Explaining types of tests. Basics of unit testing with Jest

Hello! Today we start another big series, which is about JavaScript testing. There are various different types of tests and we will start by explaining some of them. In the beginning, we will cover the basics of unit testing , which is testing individual ... more


Monday, 20 August, 2018 UTC

Webpack 4 course – part eight. Dynamic imports with prefetch and preload

Webpack 4 course – part eight. Dynamic imports with prefetch and preload

In the first article of this Webpack 4 course series, we’ve covered imports and exports. This time we will dig deeper into dynamic imports because they deserve a separate article. We will explain what they are and how to use them. Let’s start! Webpack ... more


Monday, 13 August, 2018 UTC

Webpack 4 course – part seven. Decreasing the bundle size with tree shaking

Webpack 4 course – part seven. Decreasing the bundle size with tree shaking

In this part of our webpack 4 course, we will take the idea of optimization even further. We will learn what the tree shaking is and how to use it. You will find out what requirements you need to meet in order for the Webpack 4 tree shaking to work and ... more


Monday, 6 August, 2018 UTC

Webpack 4 course – part six. Increasing development experience

Webpack 4 course – part six. Increasing development experience

Today we will cover the development value of the mode property. It will automatically set the webpack configuration for you to make the development easier. Aside from that, we will also cover the wepback-dev-server and webpack-serve – Hot Module Replacement ... more


Monday, 30 July, 2018 UTC

Webpack 4 course – part five. Built-in optimization for production

Webpack 4 course – part five. Built-in optimization for production

In this part of the Webpack 4 course, we will focus on increasing the experience of users of your application by making our output smaller. This will mean handling the code in a different way in the production environment. Today we will explain the built-in ... more


Monday, 23 July, 2018 UTC

Webpack 4 course – part three. Working with plugins

Webpack 4 course – part three. Working with plugins

Hello! Today we introduce the concept of plugins. They differ from loaders in a way that they can perform a wider range of tasks. Basically, they do anything else, that loaders can’t do. While loaders are tied to a certain type of files, plugins can ... more


Monday, 16 July, 2018 UTC

Webpack 4 course – part two. Using loaders to handle scss, image files and transpile JS

Webpack 4 course – part two. Using loaders to handle scss, image files and transpile JS

Today we continue our webpack 4 tutorial. After walking through the basic concepts of webpack, it is time to go deeper. This time we will cover something that is a great strength of webpack: loaders. First, we will learn how to use loaders that are available. ... more


Monday, 16 July, 2018 UTC

Webpack 4 course – part one. Entry, output and ES6 modules

Webpack 4 course – part one. Entry, output and ES6 modules

Hello! Today we begin a webpack 4 course. We will start with the basic concepts of Webpack, with every part of the course going deeper. This time we will learn the basics of module bundling using ES6 modules. Webpack 4 provide default configuration, ... more


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