ECMA-262-3 in detail. Chapter 3. This.

Read this article in: Russian.

Introduction

In this article we will discuss one more detail directly related with execution contexts. The topic of discussion is the this keyword.
Continue reading

ECMA-262-3 in detail. Chapter 7.2. OOP: ECMAScript implementation.

Read this article in: Russian, French.

Introduction

This is the second part of article about object-oriented programming in ECMAScript. In the first part we discussed the general theory and drew parallels with ECMAScript. Before reading of the current part, if it is necessary, I recommend reading the first part as in this article we will actively use the passed terminology. You can find the first part here: ECMA-262-3 in detail. Chapter 7.1. OOP: The general theory.
Continue reading

ECMA-262-3 in detail. Chapter 7.1. OOP: The general theory.

Read this article in: Russian, French.

Introduction

In this article we consider major aspects of object-oriented programming in ECMAScript. That the article has not turned to “yet another” (as this topic already discussed in many articles), more attention will be given, besides, to theoretical aspects to see these processes from within. In particular, we will consider algorithms of objects creation, see how relationships between objects (including the basic relationship — inheritance) are made, and also give accurate definitions which can be used in discussions (that I hope will dispel some terminological and ideological doubts and messes arising often in articles on OOP in JavaScript). Continue reading

ECMA-262-3 in detail. Chapter 6. Closures.

Read this article in: Russian, French.

Introduction

In this article we will talk about one of the most discussed topics related to JavaScript — about closures. The topic in fact is not new, and was discussed many times. However we will try to discuss and understand it more from a theoretical perspective, and also will look at how closures are implemented in ECMAScript.
Continue reading

The quiz

Recently some JavaScript quizzes appear then and there with the competitive titles wondering whether “you know JavaScript”? The recent quizzes were by kangax, Dmitry Baranovskiy and by Nicholas C. Zakas. All that quizzes are interesting, many questions though are mostly theoretical rather than practical.

And again just for fun, I suggest another ECMAScript quiz. I won’t use some boring things such as “a+++b”; but I will more sophisticated 😉 Some interesting questions are collected from newsgroups, mailing lists, forums and from my own.

Continue reading

Тонкости ECMA-262-3. Часть 8. Стратегия передачи параметров в функцию.

Read this article in: English, French.

Введение

В этой небольшой заметке мы рассмотрим стратегии передачи параметров в функции в ECMAScript.

В общем случае данный раздел компьютерной науки называется стратегия оценки, вычисления (evaluation strategy), т.е. свод правил для оценки и определения какого-либо выражения. Стратегия передачи параметров в функцию, является её частным случаем.
Continue reading

Тонкости ECMA-262-3. Часть 7.2. ООП: Реализация в ECMAScript.

Read this article in: English, French.

Введение

Данная статья является продолжением статьи об объектно-ориентированном программировании в ECMAScript. В первой части мы разбирали общую теорию и проводили параллели с ECMAScript. Перед прочтением текущей части, если есть необходимость, я рекомендую прочесть первую часть, поскольку в этой статьей мы будет активно опираться на пройденную терминологию. Желающие могут найти первую часть здесь: Тонкости ECMA-262-3. Часть 7.1. ООП: Общая теория.
Continue reading

Тонкости ECMA-262-3. Часть 7.1. ООП: Общая теория.

Read this article in: English, French.

Введение

В данной статье мы рассмотрим ключевые моменты, касающиеся объектно-ориентированного программирования в ECMAScript. Чтобы данный материал не получился “очередным” (ведь подобная тема поднималась уже не раз в различных статьях), больше внимания будет уделено, опять же, теоретическим аспектам, чтобы увидеть эти процессы изнутри. В частности, мы рассмотрим алгоритмы конструирования объектов, увидим, как строятся связи между ними (в том числе, и основная связь – наследование), а также дадим чёткие определения, которыми можно оперировать (что, надеюсь, развеет какие-то терминологические и идеологические сомнения и путаницы, возникающие часто в статьях об ООП в JavaScript). Continue reading

Тонкости ECMA-262-3. Часть 6. Замыкания.

Read this article in: English, French.

Введение

В этой заметке мы поговорим об одной из наиболее обсуждаемых тем, связанных с JavaScript — о замыканиях. Тема, по сути, избита; существует немалое количество статей, посвящённых этой структуре (некоторые из них очень хорошие, например, статья R. Cornford-a, представленная в списке дополнительной литературы), однако мы постараемся разобрать её более с теоретической точки зрения, и посмотрим, как замыкания в ECMAScript устроены изнутри.
Continue reading

Тонкости ECMA-262-3. Часть 5. Функции.

Read this article in: English, French.

Введение

В этой заметке мы подробней поговорим об одном из основных видов объектов ECMAScript — о функциях. В частности, рассмотрим различные виды функций, определим, как тот или иной вид влияет на объект переменных контекста и, какое содержание имеет цепь областей видимости контекста, связанного с определённым видом функции. Continue reading