What every JavaScript developer should know about Unicode

This story starts with a confession: I was afraid of Unicode for a long time. When a programming task required Unicode knowledge, I was searching for a hackable solution for the problem, without detailed sense what I was doing. My avoiding continued until I faced a problem that required detailed Unicode knowledge. There was no way to apply situational solutions. After applying some efforts, reading… Continue reading

Make your JavaScript code shine: knockout old ES5 hacks (Part 2)

Many developers were frustrated about JavaScript, especially before ECMAScript 2015 standard. And they had the right too: the language is known for its weakness and initial design drawbacks. How did it happen? At the beginning of the web era, no one did know how exactly the web will look in 10 - 15 years. And especially that a small Java's brother JavaScript will become the… Continue reading

Make your JavaScript code shine: knockout old ES5 hacks

It's known that before ECMAScript 2015 JavaScript language was tricky. For simple scripts ES5 code works fine. But as soon as the application complexity grows, you start to feel that the lack of language constructs is making your code unpleasant. Because you have to implement the application requirements, you can't jump over the parts of code that are troublesome to implement in ES5 style. The… Continue reading

Detailed overview of well-known symbols

Symbol is a new primitive type available from ECMAScript 2015, which allow to create unique identifiers let uniqueKey = Symbol('SymbolName'). You may use symbols as keys of properties in objects. A list of symbols that JavaScript treats specially is published as well-known symbols. Well-known symbols are used by built-in JavaScript algorithms. For example Symbol.iterator is utilized to iterate over items in arrays, strings, or… Continue reading

Why object literals in JavaScript are cool

Before ECMAScript 2015 object literals (also named object initializers) in JavaScript were quite elementary. It was possible to define 2 types of properties: Pairs of property names and related values { name1: value1 } Getters { get name(){..} } and setters { set name(val){..} } for computed property values Sadly, the object literal possibilities match into a single example: Try in JS Bin var myObject = { myString: 'value 1', get myNumber(… Continue reading

Yes. JavaScript rises.

It is hard to find a developer who didn't write JavaScript code. These days ECMAScript 2015 makes JavaScript the supreme leader of the Web. Let's see how JavaScript rises from a complementary language back in 1995 until these days, when it becomes very popular and conquerors the client and server side web development. The dark JavaScript was created in about 10 days by Brendan Eich… Continue reading

Power up the array creation in JavaScript

The array is an ordered collection of objects or primitive types. It's hard to imagine an application that doesn't use this data structure. Working with arrays consists in the following phases: Initialize the array and setup the initial elements Access the array elements by index Add new elements Remove existing elements The current article covers the array initialization and setting the initial elements. The basic… Continue reading

Six ways to declare JavaScript functions

A function is a parametric block of code defined one time and called any number of times later. In JavaScript a function is composed and influenced by many components: JavaScript code that forms the function body The list of function parameters The variables accessible from the outer scope The returned value The context this when the function is invoked Named or anonymous function The variable… Continue reading

How three dots changed JavaScript

When accessing arguments values in a function call, I always felt uncomfortable with arguments object. Its hardcoded name makes difficult to access arguments of an outer function in an inner one (which defines its own arguments). Even worse JavaScript provides it as an array-like object. It is not possible to use array methods like .map() or .forEach() directly on it. To access arguments from the… Continue reading

When 'not' to use arrow functions

It is a pleasure to see the evolution of the programming language you code every day. Learning from mistakes, searching for better implementation, creating new features is what makes the progress from version to version. This is happening to JavaScript these years, when ECMAScript 6 brings the language to a new level of usability: arrow functions, classes and much more. And this is great! One… Continue reading