diff --git a/1-js/04-object-basics/01-object/8-multiply-numeric/solution.md b/1-js/01-a/1-a1/1-camelcase/solution.md
similarity index 100%
rename from 1-js/04-object-basics/01-object/8-multiply-numeric/solution.md
rename to 1-js/01-a/1-a1/1-camelcase/solution.md
diff --git a/1-js/01-a/1-a1/1-camelcase/solution/index.js b/1-js/01-a/1-a1/1-camelcase/solution/index.js
new file mode 100644
index 0000000000..a4edefb4ab
--- /dev/null
+++ b/1-js/01-a/1-a1/1-camelcase/solution/index.js
@@ -0,0 +1 @@
+function camelize(str) {return str.split('-').map((word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1)).join('');}
diff --git a/1-js/01-a/1-a1/1-camelcase/source/index.js b/1-js/01-a/1-a1/1-camelcase/source/index.js
new file mode 100644
index 0000000000..c420d5da52
--- /dev/null
+++ b/1-js/01-a/1-a1/1-camelcase/source/index.js
@@ -0,0 +1,10 @@
+function camelize(str) {
+ return str
+ .split('-') // разбивает 'my-long-word' на массив ['my', 'long', 'word']
+ .map(
+ // Переводит в верхний регистр первые буквы всех элементом массива за исключением первого
+ // превращает ['my', 'long', 'word'] в ['my', 'Long', 'Word']
+ (word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1)
+ )
+ .join(''); // соединяет ['my', 'Long', 'Word'] в 'myLongWord'
+}
diff --git a/1-js/05-data-types/05-array-methods/1-camelcase/_js.view/test.js b/1-js/01-a/1-a1/1-camelcase/source/test.js
similarity index 54%
rename from 1-js/05-data-types/05-array-methods/1-camelcase/_js.view/test.js
rename to 1-js/01-a/1-a1/1-camelcase/source/test.js
index bcf5e95552..dadbd1a49c 100644
--- a/1-js/05-data-types/05-array-methods/1-camelcase/_js.view/test.js
+++ b/1-js/01-a/1-a1/1-camelcase/source/test.js
@@ -1,19 +1,18 @@
describe("camelize", function() {
it("leaves an empty line as is", function() {
- assert.equal(camelize(""), "");
+ expect(camelize("")).toEqual("");
});
it("turns background-color into backgroundColor", function() {
- assert.equal(camelize("background-color"), "backgroundColor");
+ expect(camelize("background-color")).toEqual(["background", "color"])
});
it("turns list-style-image into listStyleImage", function() {
- assert.equal(camelize("list-style-image"), "listStyleImage");
+ expect(camelize("list-style-image")).toEqual("listStyleImage");
});
it("turns -webkit-transition into WebkitTransition", function() {
- assert.equal(camelize("-webkit-transition"), "WebkitTransition");
+ expect(camelize("-webkit-transition")).toEqual("WebkitTransition")
});
-
-});
\ No newline at end of file
+});
diff --git a/1-js/05-data-types/05-array-methods/1-camelcase/task.md b/1-js/01-a/1-a1/1-camelcase/task.md
similarity index 98%
rename from 1-js/05-data-types/05-array-methods/1-camelcase/task.md
rename to 1-js/01-a/1-a1/1-camelcase/task.md
index ef5944636e..8f578d940b 100644
--- a/1-js/05-data-types/05-array-methods/1-camelcase/task.md
+++ b/1-js/01-a/1-a1/1-camelcase/task.md
@@ -1,4 +1,5 @@
importance: 5
+type: js
---
diff --git a/1-js/05-data-types/03-string/4-extract-currency/solution.md b/1-js/01-a/1-a1/2-runjs/solution.md
similarity index 100%
rename from 1-js/05-data-types/03-string/4-extract-currency/solution.md
rename to 1-js/01-a/1-a1/2-runjs/solution.md
diff --git a/1-js/05-data-types/05-array-methods/1-camelcase/_js.view/solution.js b/1-js/01-a/1-a1/2-runjs/solution/index.js
similarity index 100%
rename from 1-js/05-data-types/05-array-methods/1-camelcase/_js.view/solution.js
rename to 1-js/01-a/1-a1/2-runjs/solution/index.js
diff --git a/1-js/01-a/1-a1/2-runjs/source/index.js b/1-js/01-a/1-a1/2-runjs/source/index.js
new file mode 100644
index 0000000000..beab1ac3b2
--- /dev/null
+++ b/1-js/01-a/1-a1/2-runjs/source/index.js
@@ -0,0 +1 @@
+console.log("Test", "passed");
\ No newline at end of file
diff --git a/1-js/01-a/1-a1/2-runjs/source/test.js b/1-js/01-a/1-a1/2-runjs/source/test.js
new file mode 100644
index 0000000000..dc9f93e320
--- /dev/null
+++ b/1-js/01-a/1-a1/2-runjs/source/test.js
@@ -0,0 +1,6 @@
+describe("runjs", function() {
+
+ it("passes", function() { });
+ it("fails", function() { throw new Error("FAIL") });
+
+});
\ No newline at end of file
diff --git a/1-js/01-a/1-a1/2-runjs/task.md b/1-js/01-a/1-a1/2-runjs/task.md
new file mode 100644
index 0000000000..8f578d940b
--- /dev/null
+++ b/1-js/01-a/1-a1/2-runjs/task.md
@@ -0,0 +1,20 @@
+importance: 5
+type: js
+
+---
+
+# Translate border-left-width to borderLeftWidth
+
+Write the function `camelize(str)` that changes dash-separated words like "my-short-string" into camel-cased "myShortString".
+
+That is: removes all dashes, each word after dash becomes uppercased.
+
+Examples:
+
+```js
+camelize("background-color") == 'backgroundColor';
+camelize("list-style-image") == 'listStyleImage';
+camelize("-webkit-transition") == 'WebkitTransition';
+```
+
+P.S. Hint: use `split` to split the string into an array, transform it and `join` back.
diff --git a/1-js/05-data-types/05-array-methods/1-camelcase/solution.md b/1-js/01-a/1-a1/3-errorjs/solution.md
similarity index 100%
rename from 1-js/05-data-types/05-array-methods/1-camelcase/solution.md
rename to 1-js/01-a/1-a1/3-errorjs/solution.md
diff --git a/1-js/01-a/1-a1/3-errorjs/solution/index.js b/1-js/01-a/1-a1/3-errorjs/solution/index.js
new file mode 100644
index 0000000000..490f570ada
--- /dev/null
+++ b/1-js/01-a/1-a1/3-errorjs/solution/index.js
@@ -0,0 +1,10 @@
+function camelize(str) {
+ return str
+ .split('-') // splits 'my-long-word' into array ['my', 'long', 'word']
+ .map(
+ // capitalizes first letters of all array items except the first one
+ // converts ['my', 'long', 'word'] into ['my', 'Long', 'Word']
+ (word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1)
+ )
+ .join(''); // joins ['my', 'Long', 'Word'] into 'myLongWord'
+}
diff --git a/1-js/01-a/1-a1/3-errorjs/source/index.js b/1-js/01-a/1-a1/3-errorjs/source/index.js
new file mode 100644
index 0000000000..4cb7888c93
--- /dev/null
+++ b/1-js/01-a/1-a1/3-errorjs/source/index.js
@@ -0,0 +1,6 @@
+
+function f() {
+ throw new Error("ERR");
+}
+
+f();
\ No newline at end of file
diff --git a/1-js/01-a/1-a1/3-errorjs/source/test.js b/1-js/01-a/1-a1/3-errorjs/source/test.js
new file mode 100644
index 0000000000..3202f2da1d
--- /dev/null
+++ b/1-js/01-a/1-a1/3-errorjs/source/test.js
@@ -0,0 +1,6 @@
+describe("errorjs", function() {
+
+ it("passes", function() { });
+ it("fails", function() { throw new Error("FAIL") });
+
+});
\ No newline at end of file
diff --git a/1-js/01-a/1-a1/3-errorjs/task.md b/1-js/01-a/1-a1/3-errorjs/task.md
new file mode 100644
index 0000000000..8f578d940b
--- /dev/null
+++ b/1-js/01-a/1-a1/3-errorjs/task.md
@@ -0,0 +1,20 @@
+importance: 5
+type: js
+
+---
+
+# Translate border-left-width to borderLeftWidth
+
+Write the function `camelize(str)` that changes dash-separated words like "my-short-string" into camel-cased "myShortString".
+
+That is: removes all dashes, each word after dash becomes uppercased.
+
+Examples:
+
+```js
+camelize("background-color") == 'backgroundColor';
+camelize("list-style-image") == 'listStyleImage';
+camelize("-webkit-transition") == 'WebkitTransition';
+```
+
+P.S. Hint: use `split` to split the string into an array, transform it and `join` back.
diff --git a/1-js/05-data-types/05-array-methods/12-reduce-object/solution.md b/1-js/01-a/1-a1/4-syntaxerrorjs/solution.md
similarity index 100%
rename from 1-js/05-data-types/05-array-methods/12-reduce-object/solution.md
rename to 1-js/01-a/1-a1/4-syntaxerrorjs/solution.md
diff --git a/1-js/01-a/1-a1/4-syntaxerrorjs/solution/index.js b/1-js/01-a/1-a1/4-syntaxerrorjs/solution/index.js
new file mode 100644
index 0000000000..490f570ada
--- /dev/null
+++ b/1-js/01-a/1-a1/4-syntaxerrorjs/solution/index.js
@@ -0,0 +1,10 @@
+function camelize(str) {
+ return str
+ .split('-') // splits 'my-long-word' into array ['my', 'long', 'word']
+ .map(
+ // capitalizes first letters of all array items except the first one
+ // converts ['my', 'long', 'word'] into ['my', 'Long', 'Word']
+ (word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1)
+ )
+ .join(''); // joins ['my', 'Long', 'Word'] into 'myLongWord'
+}
diff --git a/1-js/01-a/1-a1/4-syntaxerrorjs/source/index.js b/1-js/01-a/1-a1/4-syntaxerrorjs/source/index.js
new file mode 100644
index 0000000000..f3a187a7cc
--- /dev/null
+++ b/1-js/01-a/1-a1/4-syntaxerrorjs/source/index.js
@@ -0,0 +1,7 @@
+function f() {
+ throw new Error("ERR");
+}
+
+{{{
+
+f();
\ No newline at end of file
diff --git a/1-js/01-a/1-a1/4-syntaxerrorjs/source/test.js b/1-js/01-a/1-a1/4-syntaxerrorjs/source/test.js
new file mode 100644
index 0000000000..3202f2da1d
--- /dev/null
+++ b/1-js/01-a/1-a1/4-syntaxerrorjs/source/test.js
@@ -0,0 +1,6 @@
+describe("errorjs", function() {
+
+ it("passes", function() { });
+ it("fails", function() { throw new Error("FAIL") });
+
+});
\ No newline at end of file
diff --git a/1-js/01-a/1-a1/4-syntaxerrorjs/task.md b/1-js/01-a/1-a1/4-syntaxerrorjs/task.md
new file mode 100644
index 0000000000..8f578d940b
--- /dev/null
+++ b/1-js/01-a/1-a1/4-syntaxerrorjs/task.md
@@ -0,0 +1,20 @@
+importance: 5
+type: js
+
+---
+
+# Translate border-left-width to borderLeftWidth
+
+Write the function `camelize(str)` that changes dash-separated words like "my-short-string" into camel-cased "myShortString".
+
+That is: removes all dashes, each word after dash becomes uppercased.
+
+Examples:
+
+```js
+camelize("background-color") == 'backgroundColor';
+camelize("list-style-image") == 'listStyleImage';
+camelize("-webkit-transition") == 'WebkitTransition';
+```
+
+P.S. Hint: use `split` to split the string into an array, transform it and `join` back.
diff --git a/1-js/01-a/1-a1/article.md b/1-js/01-a/1-a1/article.md
new file mode 100644
index 0000000000..d2923b8cbb
--- /dev/null
+++ b/1-js/01-a/1-a1/article.md
@@ -0,0 +1,3 @@
+# An Introduction to JavaScript
+
+Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.
diff --git a/1-js/01-getting-started/index.md b/1-js/01-a/index.md
similarity index 100%
rename from 1-js/01-getting-started/index.md
rename to 1-js/01-a/index.md
diff --git a/1-js/01-getting-started/1-intro/article.md b/1-js/01-getting-started/1-intro/article.md
deleted file mode 100644
index 30d08f05dc..0000000000
--- a/1-js/01-getting-started/1-intro/article.md
+++ /dev/null
@@ -1,120 +0,0 @@
-# An Introduction to JavaScript
-
-Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.
-
-## What is JavaScript?
-
-*JavaScript* was initially created to "make web pages alive".
-
-The programs in this language are called *scripts*. They can be written right in a web page's HTML and run automatically as the page loads.
-
-Scripts are provided and executed as plain text. They don't need special preparation or compilation to run.
-
-In this aspect, JavaScript is very different from another language called [Java](https://en.wikipedia.org/wiki/Java_(programming_language)).
-
-```smart header="Why is it called JavaScript?"
-When JavaScript was created, it initially had another name: "LiveScript". But Java was very popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.
-
-But as it evolved, JavaScript became a fully independent language with its own specification called [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), and now it has no relation to Java at all.
-```
-
-Today, JavaScript can execute not only in the browser, but also on the server, or actually on any device that has a special program called [the JavaScript engine](https://en.wikipedia.org/wiki/JavaScript_engine).
-
-The browser has an embedded engine sometimes called a "JavaScript virtual machine".
-
-Different engines have different "codenames". For example:
-
-- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
-- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
-- ...There are other codenames like "Trident" and "Chakra" for different versions of IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc.
-
-The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome and Opera.
-
-```smart header="How do engines work?"
-
-Engines are complicated. But the basics are easy.
-
-1. The engine (embedded if it's a browser) reads ("parses") the script.
-2. Then it converts ("compiles") the script to the machine language.
-3. And then the machine code runs, pretty fast.
-
-The engine applies optimizations at each step of the process. It even watches the compiled script as it runs, analyzes the data that flows through it, and further optimizes the machine code based on that knowledge.
-```
-
-## What can in-browser JavaScript do?
-
-Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it.
-
-JavaScript's capabilities greatly depend on the environment it's running in. For instance, [Node.js](https://wikipedia.org/wiki/Node.js) supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.
-
-In-browser JavaScript can do everything related to webpage manipulation, interaction with the user, and the webserver.
-
-For instance, in-browser JavaScript is able to:
-
-- Add new HTML to the page, change the existing content, modify styles.
-- React to user actions, run on mouse clicks, pointer movements, key presses.
-- Send requests over the network to remote servers, download and upload files (so-called [AJAX](https://en.wikipedia.org/wiki/Ajax_(programming)) and [COMET](https://en.wikipedia.org/wiki/Comet_(programming)) technologies).
-- Get and set cookies, ask questions to the visitor, show messages.
-- Remember the data on the client-side ("local storage").
-
-## What CAN'T in-browser JavaScript do?
-
-JavaScript's abilities in the browser are limited for the sake of the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
-
-Examples of such restrictions include:
-
-- JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS functions.
-
- Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like "dropping" a file into a browser window or selecting it via an `` tag.
-
- There are ways to interact with camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
-- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other if they come from different sites (from a different domain, protocol or port).
-
- This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and contain a special JavaScript code that handles it. We'll cover that in the tutorial.
-
- This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com` and steal information from there.
-- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
-
-
-
-Such limits do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugin/extensions which may ask for extended permissions.
-
-## What makes JavaScript unique?
-
-There are at least *three* great things about JavaScript:
-
-```compare
-+ Full integration with HTML/CSS.
-+ Simple things are done simply.
-+ Support by all major browsers and enabled by default.
-```
-JavaScript is the only browser technology that combines these three things.
-
-That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.
-
-That said, JavaScript also allows to create servers, mobile applications, etc.
-
-## Languages "over" JavaScript
-
-The syntax of JavaScript does not suit everyone's needs. Different people want different features.
-
-That's to be expected, because projects and requirements are different for everyone.
-
-So recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
-
-Modern tools make the transpilation very fast and transparent, actually allowing developers to code in another language and auto-converting it "under the hood".
-
-Examples of such languages:
-
-- [CoffeeScript](http://coffeescript.org/) is a "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
-- [TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
-- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
-- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.
-
-There are more. Of course, even if we use one of transpiled languages, we should also know JavaScript to really understand what we're doing.
-
-## Summary
-
-- JavaScript was initially created as a browser-only language, but is now used in many other environments as well.
-- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration with HTML/CSS.
-- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
diff --git a/1-js/01-getting-started/1-intro/limitations.svg b/1-js/01-getting-started/1-intro/limitations.svg
deleted file mode 100644
index a7863c63cc..0000000000
--- a/1-js/01-getting-started/1-intro/limitations.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/1-js/01-getting-started/2-manuals-specifications/article.md b/1-js/01-getting-started/2-manuals-specifications/article.md
deleted file mode 100644
index 85a7737cb0..0000000000
--- a/1-js/01-getting-started/2-manuals-specifications/article.md
+++ /dev/null
@@ -1,42 +0,0 @@
-
-# Manuals and specifications
-
-This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other sources.
-
-## Specification
-
-[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
-
-But being that formalized, it's difficult to understand at first. So if you need the most trustworthy source of information about the language details, the specification is the right place. But it's not for everyday use.
-
-A new specification version is released every year. In-between these releases, the latest specification draft is at .
-
-To read about new bleeding-edge features, including those that are "almost standard" (so-called "stage 3"), see proposals at .
-
-Also, if you're in developing for the browser, then there are other specs covered in the [second part](info:browser-environment) of the tutorial.
-
-## Manuals
-
-- **MDN (Mozilla) JavaScript Reference** is a manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc.
-
- One can find it at .
-
- Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. to search for `parseInt` function.
-
-
-- **MSDN** – Microsoft manual with a lot of information, including JavaScript (often referred to as JScript). If one needs something specific to Internet Explorer, better go there: .
-
- Also, we can use an internet search with phrases such as "RegExp MSDN" or "RegExp MSDN jscript".
-
-## Compatibility tables
-
-JavaScript is a developing language, new features get added regularly.
-
-To see their support among browser-based and other engines, see:
-
-- - per-feature tables of support, e.g. to see which engines support modern cryptography functions: .
-- - a table with language features and engines that support those or don't support.
-
-All these resources are useful in real-life development, as they contain valuable information about language details, their support etc.
-
-Please remember them (or this page) for the cases when you need in-depth information about a particular feature.
diff --git a/1-js/01-getting-started/3-code-editors/article.md b/1-js/01-getting-started/3-code-editors/article.md
deleted file mode 100644
index d03f03defb..0000000000
--- a/1-js/01-getting-started/3-code-editors/article.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Code editors
-
-A code editor is the place where programmers spend most of their time.
-
-There are two main types of code editors: IDEs and lightweight editors. Many people use one tool of each type.
-
-## IDE
-
-The term [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) refers to a powerful editor with many features that usually operates on a "whole project." As the name suggests, it's not just an editor, but a full-scale "development environment."
-
-An IDE loads the project (which can be many files), allows navigation between files, provides autocompletion based on the whole project (not just the open file), and integrates with a version management system (like [git](https://git-scm.com/)), a testing environment, and other "project-level" stuff.
-
-If you haven't selected an IDE yet, consider the following options:
-
-- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
-- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).
-
-For Windows, there's also "Visual Studio", not to be confused with "Visual Studio Code". "Visual Studio" is a paid and mighty Windows-only editor, well-suited for the .NET platform. It's also good at JavaScript. There's also a free version [Visual Studio Community](https://www.visualstudio.com/vs/community/).
-
-Many IDEs are paid, but have a trial period. Their cost is usually negligible compared to a qualified developer's salary, so just choose the best one for you.
-
-## Lightweight editors
-
-"Lightweight editors" are not as powerful as IDEs, but they're fast, elegant and simple.
-
-They are mainly used to open and edit a file instantly.
-
-The main difference between a "lightweight editor" and an "IDE" is that an IDE works on a project-level, so it loads much more data on start, analyzes the project structure if needed and so on. A lightweight editor is much faster if we need only one file.
-
-In practice, lightweight editors may have a lot of plugins including directory-level syntax analyzers and autocompleters, so there's no strict border between a lightweight editor and an IDE.
-
-The following options deserve your attention:
-
-- [Atom](https://atom.io/) (cross-platform, free).
-- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
-- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
-- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
-- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
-
-## Let's not argue
-
-The editors in the lists above are those that either I or my friends whom I consider good developers have been using for a long time and are happy with.
-
-There are other great editors in our big world. Please choose the one you like the most.
-
-The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
diff --git a/1-js/01-getting-started/4-devtools/article.md b/1-js/01-getting-started/4-devtools/article.md
deleted file mode 100644
index 50926d4f76..0000000000
--- a/1-js/01-getting-started/4-devtools/article.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# Developer console
-
-Code is prone to errors. You will quite likely make errors... Oh, what am I talking about? You are *absolutely* going to make errors, at least if you're a human, not a [robot](https://en.wikipedia.org/wiki/Bender_(Futurama)).
-
-But in the browser, users don't see errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it.
-
-To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers.
-
-Most developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific.
-
-Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.
-
-## Google Chrome
-
-Open the page [bug.html](bug.html).
-
-There's an error in the JavaScript code on it. It's hidden from a regular visitor's eyes, so let's open developer tools to see it.
-
-Press `key:F12` or, if you're on Mac, then `key:Cmd+Opt+J`.
-
-The developer tools will open on the Console tab by default.
-
-It looks somewhat like this:
-
-
-
-The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar.
-
-- Here we can see the red-colored error message. In this case, the script contains an unknown "lalala" command.
-- On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occurred.
-
-Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them.
-
-Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter .
-
-```smart header="Multi-line input"
-Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
-
-To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
-```
-
-## Firefox, Edge, and others
-
-Most other browsers use `key:F12` to open developer tools.
-
-The look & feel of them is quite similar. Once you know how to use one of these tools (you can start with Chrome), you can easily switch to another.
-
-## Safari
-
-Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first.
-
-Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom:
-
-
-
-Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options.
-
-## Summary
-
-- Developer tools allow us to see errors, run commands, examine variables, and much more.
-- They can be opened with `key:F12` for most browsers on Windows. Chrome for Mac needs `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (need to enable first).
-
-Now we have the environment ready. In the next section, we'll get down to JavaScript.
diff --git a/1-js/01-getting-started/4-devtools/bug.html b/1-js/01-getting-started/4-devtools/bug.html
deleted file mode 100644
index edb02375ca..0000000000
--- a/1-js/01-getting-started/4-devtools/bug.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
- There is an error in the script on this page.
-
-
-
-
-
\ No newline at end of file
diff --git a/1-js/01-getting-started/4-devtools/chrome.png b/1-js/01-getting-started/4-devtools/chrome.png
deleted file mode 100644
index 4cb3ea2f46..0000000000
Binary files a/1-js/01-getting-started/4-devtools/chrome.png and /dev/null differ
diff --git a/1-js/01-getting-started/4-devtools/chrome@2x.png b/1-js/01-getting-started/4-devtools/chrome@2x.png
deleted file mode 100644
index b87404a8f4..0000000000
Binary files a/1-js/01-getting-started/4-devtools/chrome@2x.png and /dev/null differ
diff --git a/1-js/01-getting-started/4-devtools/safari.png b/1-js/01-getting-started/4-devtools/safari.png
deleted file mode 100644
index 64c7a3f6ca..0000000000
Binary files a/1-js/01-getting-started/4-devtools/safari.png and /dev/null differ
diff --git a/1-js/01-getting-started/4-devtools/safari@2x.png b/1-js/01-getting-started/4-devtools/safari@2x.png
deleted file mode 100644
index 27def4d09b..0000000000
Binary files a/1-js/01-getting-started/4-devtools/safari@2x.png and /dev/null differ
diff --git a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.md b/1-js/02-b/1-b1/2-hoverintent/solution.md
similarity index 100%
rename from 2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.md
rename to 1-js/02-b/1-b1/2-hoverintent/solution.md
diff --git a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/hoverIntent.js b/1-js/02-b/1-b1/2-hoverintent/solution/hoverIntent.js
similarity index 98%
rename from 2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/hoverIntent.js
rename to 1-js/02-b/1-b1/2-hoverintent/solution/hoverIntent.js
index 4e6e2a3e95..c9b307aae2 100644
--- a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/hoverIntent.js
+++ b/1-js/02-b/1-b1/2-hoverintent/solution/hoverIntent.js
@@ -1,6 +1,4 @@
-'use strict';
-
-class HoverIntent {
+export default class HoverIntent {
constructor({
sensitivity = 0.1, // speed less than 0.1px/ms means "hovering over an element"
diff --git a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/source.view/hoverIntent.js b/1-js/02-b/1-b1/2-hoverintent/source/hoverIntent.js
similarity index 94%
rename from 2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/source.view/hoverIntent.js
rename to 1-js/02-b/1-b1/2-hoverintent/source/hoverIntent.js
index a38b42bc24..9fd479a4e0 100644
--- a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/source.view/hoverIntent.js
+++ b/1-js/02-b/1-b1/2-hoverintent/source/hoverIntent.js
@@ -1,8 +1,6 @@
-'use strict';
-
// Here's a brief sketch of the class
// with things that you'll need anyway
-class HoverIntent {
+export default class HoverIntent {
constructor({
sensitivity = 0.1, // speed less than 0.1px/ms means "hovering over an element"
@@ -27,10 +25,10 @@ class HoverIntent {
elem.addEventListener("mouseout", this.onMouseOut);
// continue from this point
-
}
onMouseOver(event) {
+ console.log("OVER", event);
/* ... */
}
diff --git a/1-js/02-b/1-b1/2-hoverintent/source/index.html b/1-js/02-b/1-b1/2-hoverintent/source/index.html
new file mode 100644
index 0000000000..3ad401bb12
--- /dev/null
+++ b/1-js/02-b/1-b1/2-hoverintent/source/index.html
@@ -0,0 +1,25 @@
+
+
+
+
diff --git a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/style.css b/1-js/02-b/1-b1/2-hoverintent/source/style.css
similarity index 100%
rename from 2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/style.css
rename to 1-js/02-b/1-b1/2-hoverintent/source/style.css
diff --git a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/test.js b/1-js/02-b/1-b1/2-hoverintent/source/test.js
similarity index 79%
rename from 2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/test.js
rename to 1-js/02-b/1-b1/2-hoverintent/source/test.js
index f5d4aaffb3..aad3bca086 100644
--- a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/solution.view/test.js
+++ b/1-js/02-b/1-b1/2-hoverintent/source/test.js
@@ -1,7 +1,6 @@
-'use strict';
+import HoverIntent from './hoverIntent.js';
describe("hoverIntent", function() {
-
function mouse(eventType, x, y, options) {
let eventOptions = Object.assign({
bubbles: true,
@@ -18,14 +17,15 @@ describe("hoverIntent", function() {
let isOver;
let hoverIntent;
+ let clock;
- before(function() {
- this.clock = sinon.useFakeTimers();
+ beforeAll(function() {
+ clock = jasmine.clock().install();
});
- after(function() {
- this.clock.restore();
+ afterAll(function() {
+ clock.uninstall();
});
@@ -51,13 +51,13 @@ describe("hoverIntent", function() {
it("mouseover -> when the pointer just arrived, no tooltip", function() {
mouse('mouseover', 10, 10);
- assert.isFalse(isOver);
+ expect(isOver).toBeFalse();
});
it("mouseover -> after a delay, the tooltip shows up", function() {
mouse('mouseover', 10, 10);
- this.clock.tick(100);
- assert.isTrue(isOver);
+ clock.tick(100);
+ expect(isOver).toBeTrue();
});
it("mouseover -> followed by fast mouseout leads doesn't show tooltip", function() {
@@ -66,8 +66,8 @@ describe("hoverIntent", function() {
() => mouse('mouseout', 300, 300, { relatedTarget: document.body}),
30
);
- this.clock.tick(100);
- assert.isFalse(isOver);
+ clock.tick(100);
+ expect(isOver).toBeFalse();
});
@@ -79,8 +79,8 @@ describe("hoverIntent", function() {
i
);
}
- this.clock.tick(200);
- assert.isTrue(isOver);
+ clock.tick(200);
+ expect(isOver).toBeTrue();
});
it("mouseover -> fast move -> no tooltip", function() {
@@ -91,8 +91,8 @@ describe("hoverIntent", function() {
i
);
}
- this.clock.tick(200);
- assert.isFalse(isOver);
+ clock.tick(200);
+ expect(isOver).toBeTrue();
});
});
diff --git a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/task.md b/1-js/02-b/1-b1/2-hoverintent/task.md
similarity index 99%
rename from 2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/task.md
rename to 1-js/02-b/1-b1/2-hoverintent/task.md
index 72e615bdd6..9c80423b8e 100644
--- a/2-ui/3-event-details/3-mousemove-mouseover-mouseout-mouseenter-mouseleave/2-hoverintent/task.md
+++ b/1-js/02-b/1-b1/2-hoverintent/task.md
@@ -1,4 +1,5 @@
importance: 5
+type: html
---
diff --git a/1-js/02-b/1-b1/article.md b/1-js/02-b/1-b1/article.md
new file mode 100644
index 0000000000..d2923b8cbb
--- /dev/null
+++ b/1-js/02-b/1-b1/article.md
@@ -0,0 +1,3 @@
+# An Introduction to JavaScript
+
+Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.
diff --git a/1-js/02-b/index.md b/1-js/02-b/index.md
new file mode 100644
index 0000000000..b327c78603
--- /dev/null
+++ b/1-js/02-b/index.md
@@ -0,0 +1,3 @@
+# An introduction
+
+About the JavaScript language and the environment to develop with it.
diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/index.html b/1-js/02-first-steps/01-hello-world/1-hello-alert/index.html
deleted file mode 100644
index ff1d871b08..0000000000
--- a/1-js/02-first-steps/01-hello-world/1-hello-alert/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.md b/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.md
deleted file mode 100644
index 81552913b9..0000000000
--- a/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.md
+++ /dev/null
@@ -1,2 +0,0 @@
-
-[html src="http://github.com/index.html"]
diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html b/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html
deleted file mode 100644
index 45e6744b3a..0000000000
--- a/1-js/02-first-steps/01-hello-world/1-hello-alert/solution.view/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md b/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md
deleted file mode 100644
index afed6a91d3..0000000000
--- a/1-js/02-first-steps/01-hello-world/1-hello-alert/task.md
+++ /dev/null
@@ -1,12 +0,0 @@
-importance: 5
-
----
-
-# Show an alert
-
-Create a page that shows a message "I'm JavaScript!".
-
-Do it in a sandbox, or on your hard drive, doesn't matter, just ensure that it works.
-
-[demo src="http://github.com/solution"]
-
diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/alert.js b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/alert.js
deleted file mode 100644
index 4de725971d..0000000000
--- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/alert.js
+++ /dev/null
@@ -1 +0,0 @@
-alert("I'm JavaScript!");
\ No newline at end of file
diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/index.html b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/index.html
deleted file mode 100644
index 10895f8fe2..0000000000
--- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md
deleted file mode 100644
index f42c41e6db..0000000000
--- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/solution.md
+++ /dev/null
@@ -1,8 +0,0 @@
-The HTML code:
-
-[html src="http://github.com/index.html"]
-
-For the file `alert.js` in the same folder:
-
-[js src="http://github.com/alert.js"]
-
diff --git a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md b/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md
deleted file mode 100644
index 26168d6a76..0000000000
--- a/1-js/02-first-steps/01-hello-world/2-hello-alert-ext/task.md
+++ /dev/null
@@ -1,9 +0,0 @@
-importance: 5
-
----
-
-# Show an alert with an external script
-
-Take the solution of the previous task . Modify it by extracting the script content into an external file `alert.js`, residing in the same folder.
-
-Open the page, ensure that the alert works.
diff --git a/1-js/02-first-steps/01-hello-world/article.md b/1-js/02-first-steps/01-hello-world/article.md
deleted file mode 100644
index b3149f1121..0000000000
--- a/1-js/02-first-steps/01-hello-world/article.md
+++ /dev/null
@@ -1,132 +0,0 @@
-# Hello, world!
-
-This part of the tutorial is about core JavaScript, the language itself.
-
-But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.js). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial.
-
-So first, let's see how we attach a script to a webpage. For server-side environments (like Node.js), you can execute the script with a command like `"node my.js"`.
-
-
-## The "script" tag
-
-JavaScript programs can be inserted into any part of an HTML document with the help of the `
-*/!*
-
-