diff --git a/1-js/9-prototypes/1-prototype/article.md b/1-js/9-prototypes/1-prototype/article.md
index a40dd584..f0e1be00 100644
--- a/1-js/9-prototypes/1-prototype/article.md
+++ b/1-js/9-prototypes/1-prototype/article.md
@@ -13,6 +13,7 @@
Пример кода (кроме IE10-):
+
\n\n\n \n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e563d9c5f42629dc76e" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e583d9c5f42629dc7bd" }, "plunkId" : "ZKPUR10anbQNmAB2tVdo", "webPath" : "/task/pow-nan-spec/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e583d9c5f42629dc7be" } }, { "content" : "describe(\"pow\", function() {\n\n describe(\"возводит x в степень n\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n });\n\n it(\"при возведении в отрицательную степень результат NaN\", function() {\n assert( isNaN( pow(2, -1) ), \"pow(2, -1) не NaN\" );\n });\n\n it(\"при возведении в дробную степень результат NaN\", function() {\n assert( isNaN( pow(2, 1.5) ), \"pow(2, -1.5) не NaN\" );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e583d9c5f42629dc7bf" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e593d9c5f42629dc7c0" }, "plunkId" : "WqBJ0xCrNiWEybrYvGf7", "webPath" : "/task/pow-nan-spec/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e593d9c5f42629dc7c1" } }, { "content" : "describe(\"pow\", function() {\n\n describe(\"возводит x в степень n\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n });\n\n it(\"при возведении в отрицательную степень результат NaN\", function() {\n assert( isNaN( pow(2, -1) ), \"pow(2, -1) не NaN\" );\n });\n\n it(\"при возведении в дробную степень результат NaN\", function() {\n assert( isNaN( pow(2, 1.5) ), \"pow(2, -1.5) не NaN\" );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e593d9c5f42629dc7c2" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e593d9c5f42629dc7c4" }, "plunkId" : "3mFLAA32GZkLRemHkmht", "webPath" : "/task/pow-test-0/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e593d9c5f42629dc7c5" } }, { "content" : "describe(\"pow\", function() {\n\n describe(\"возводит x в степень n\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n });\n\n it(\"при возведении в отрицательную степень результат NaN\", function() {\n assert( isNaN( pow(2, -1) ), \"pow(2, -1) не NaN\" );\n });\n\n it(\"при возведении в дробную степень результат NaN\", function() {\n assert( isNaN( pow(2, 1.5) ), \"pow(2, -1.5) не NaN\" );\n });\n\n describe(\"любое число, кроме нуля, в степени 0 равно 1\", function() {\n\n function makeTest(x) {\n it(\"при возведении \" + x + \" в степень 0 результат: 1\", function() { \n assert.equal( pow(x, 0), 1);\n });\n }\n\n for(var x = -5; x <= 5; x+=2) {\n makeTest(x);\n }\n\n });\n \n it(\"ноль в нулевой степени даёт NaN\", function() {\n assert( isNaN( pow(0,0) ), \"0 в степени 0 не NaN\");\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e593d9c5f42629dc7c6" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5a3d9c5f42629dc7c7" }, "plunkId" : "NxHLjrTWDbSSWGi20eKc", "webPath" : "/task/pow-test-0/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e5a3d9c5f42629dc7c8" } }, { "content" : "describe(\"pow\", function() {\n\n describe(\"возводит x в степень n\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n });\n\n it(\"при возведении в отрицательную степень результат NaN\", function() {\n assert( isNaN( pow(2, -1) ), \"pow(2, -1) не NaN\" );\n });\n\n it(\"при возведении в дробную степень результат NaN\", function() {\n assert( isNaN( pow(2, 1.5) ), \"pow(2, -1.5) не NaN\" );\n });\n\n describe(\"любое число, кроме нуля, в степени 0 равно 1\", function() {\n\n function makeTest(x) {\n it(\"при возведении \" + x + \" в степень 0 результат: 1\", function() { \n assert.equal( pow(x, 0), 1);\n });\n }\n\n for(var x = -5; x <= 5; x+=2) {\n makeTest(x);\n }\n\n });\n \n it(\"ноль в нулевой степени даёт NaN\", function() {\n assert( isNaN( pow(0,0) ), \"0 в степени 0 не NaN\");\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e5a3d9c5f42629dc7c9" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5a3d9c5f42629dc7cb" }, "plunkId" : "fz5leafSBT1wm1cg0DSX", "webPath" : "/article/testing/beforeafter", "files" : [ { "filename" : "test.js", "content" : "describe(\"Тест\", function() {\n\n before(function() { alert(\"Начало всех тестов\"); });\n after(function() { alert(\"Окончание всех тестов\"); });\n\n beforeEach(function() { alert(\"Вход в тест\"); });\n afterEach(function() { alert(\"Выход из теста\"); });\n\n it('тест 1', function() { alert('1'); });\n it('тест 2', function() { alert('2'); });\n\n});", "_id" : { "$oid" : "54a04e5a3d9c5f42629dc7cc" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n\n\n\n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5a3d9c5f42629dc7cd" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7ce" }, "plunkId" : "qS4zQHJVkKIuX312AxjD", "webPath" : "/article/testing/pow-1", "files" : [ { "filename" : "test.js", "content" : "describe(\"pow\", function() {\n\n it(\"возводит в n-ю степень\", function() { \n assert.equal( pow(2, 3), 8);\n });\n\n});", "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7cf" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n\n\n \n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7d0" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7d1" }, "plunkId" : "xT64DMkF3tufavDzmzpG", "webPath" : "/article/testing/pow-2", "files" : [ { "filename" : "test.js", "content" : "describe(\"pow\", function() {\n\n it(\"при возведении 2 в 3ю степень результат 8\", function() { \n assert.equal( pow(2, 3), 8);\n });\n\n it(\"при возведении 3 в 4ю степень равен 81\", function() {\n assert.equal( pow(3, 4), 81);\n });\n\n});", "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7d2" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n\n\n \n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7d3" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7d4" }, "plunkId" : "afZ72xCkP6ECnYooYsfd", "webPath" : "/article/testing/pow-3", "files" : [ { "filename" : "test.js", "content" : "describe(\"pow\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n});", "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7d5" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n\n\n \n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5b3d9c5f42629dc7d6" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5d3d9c5f42629dc7d7" }, "plunkId" : "QvQDOjPSOQEmV7I5jFES", "webPath" : "/article/testing/pow-4", "files" : [ { "filename" : "test.js", "content" : "describe(\"pow\", function() {\n\n describe(\"возводит x в степень n\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n });\n \n // ...\n \n});", "_id" : { "$oid" : "54a04e5d3d9c5f42629dc7d8" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n\n\n \n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5d3d9c5f42629dc7d9" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5d3d9c5f42629dc7da" }, "plunkId" : "yuKgiZVcWb7606pAe10V", "webPath" : "/article/testing/pow-min", "files" : [ { "filename" : "test.js", "content" : "describe(\"pow\", function() {\n\n it(\"возводит в n-ю степень\", function() { \n assert.equal( pow(2, 3), 8);\n });\n\n});", "_id" : { "$oid" : "54a04e5d3d9c5f42629dc7db" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n\n\n \n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5d3d9c5f42629dc7dc" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7dd" }, "plunkId" : "UYjxFk5mfyaPIX93FdfU", "webPath" : "/article/testing/pow-nan-assert", "files" : [ { "filename" : "test.js", "content" : "describe(\"pow\", function() {\n\n describe(\"возводит x в степень n\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n });\n \n it(\"при возведении в отрицательную степень результат NaN\", function() {\n assert( isNaN( pow(2, -1) ), \"pow(2, -1) не NaN\" );\n });\n\n it(\"при возведении в дробную степень результат NaN\", function() {\n assert( isNaN( pow(2, 1.5) ), \"pow(2, -1.5) не NaN\" );\n });\n\n});\n", "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7de" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n\n\n \n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7df" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7e0" }, "plunkId" : "hKlQTYU0erLrrYSUEGVR", "webPath" : "/article/testing/pow-nan", "files" : [ { "filename" : "test.js", "content" : "describe(\"pow\", function() {\n\n describe(\"возводит x в степень n\", function() {\n\n function makeTest(x) {\n var expected = x*x*x;\n it(\"при возведении \"+x+\" в степень 3 результат: \" + expected, function() { \n assert.equal( pow(x, 3), expected);\n });\n }\n\n for(var x = 1; x <= 5; x++) {\n makeTest(x);\n }\n\n });\n \n it(\"при возведении в отрицательную степень результат NaN\", function() {\n assert( isNaN( pow(2, -1) ) );\n });\n\n it(\"при возведении в дробную степень результат NaN\", function() {\n assert( isNaN( pow(2, 1.5) ) );\n });\n\n});\n", "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7e1" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n\n\n\n\n \n\n \n \n\n \n
\n \n \n \n\n", "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7e2" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7e6" }, "plunkId" : "kv1uA17qB3EGFZoW2X7R", "webPath" : "/task/ucfirst/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7e7" } }, { "content" : "describe(\"ucFirst\", function() {\n it('делает первый символ заглавным', function() {\n assert.strictEqual( ucFirst(\"вася\"), \"Вася\" );\n });\n \n it('для пустой строки возвращает пустую строку', function() {\n assert.strictEqual( ucFirst(\"\"), \"\" );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e5e3d9c5f42629dc7e8" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e623d9c5f42629dc7e9" }, "plunkId" : "E7RObo3GafSDZgHgoKU1", "webPath" : "/task/ucfirst/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e623d9c5f42629dc7ea" } }, { "content" : "describe(\"ucFirst\", function() {\n it('делает первый символ заглавным', function() {\n assert.strictEqual( ucFirst(\"вася\"), \"Вася\" );\n });\n \n it('для пустой строки возвращает пустую строку', function() {\n assert.strictEqual( ucFirst(\"\"), \"\" );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e623d9c5f42629dc7eb" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e623d9c5f42629dc7ed" }, "plunkId" : "6SOSgdIkSYNLSQvYxvLb", "webPath" : "/task/check-spam/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e623d9c5f42629dc7ee" } }, { "content" : "describe(\"checkSpam\", function() {\n it('считает спамом \"buy ViAgRA now\"', function() {\n assert.isTrue( checkSpam('buy ViAgRA now') );\n });\n\n it('считает спамом \"free xxxxx\"', function() {\n assert.isTrue( checkSpam('free xxxxx') );\n });\n\n it('не считает спамом \"innocent rabbit\"', function() {\n assert.isFalse( checkSpam('innocent rabbit') );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e623d9c5f42629dc7ef" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e633d9c5f42629dc7f0" }, "plunkId" : "yjbp80dtWBw6KHgflUYO", "webPath" : "/task/check-spam/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e633d9c5f42629dc7f1" } }, { "content" : "describe(\"checkSpam\", function() {\n it('считает спамом \"buy ViAgRA now\"', function() {\n assert.isTrue( checkSpam('buy ViAgRA now') );\n });\n\n it('считает спамом \"free xxxxx\"', function() {\n assert.isTrue( checkSpam('free xxxxx') );\n });\n\n it('не считает спамом \"innocent rabbit\"', function() {\n assert.isFalse( checkSpam('innocent rabbit') );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e633d9c5f42629dc7f2" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e643d9c5f42629dc7f4" }, "plunkId" : "NcrNOEBy7cN6Lhqa8KIE", "webPath" : "/task/truncate/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e643d9c5f42629dc7f5" } }, { "content" : "describe(\"truncate\", function() {\n it(\"обрезает строку до указанной длины (включая троеточие)\", function() {\n assert.equal( \n truncate(\"Вот, что мне хотелось бы сказать на эту тему:\", 20),\n \"Вот, что мне хоте...\"\n );\n });\n\n it(\"не меняет короткие строки\", function() {\n assert.equal( \n truncate(\"Всем привет!\", 20), \n \"Всем привет!\"\n );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e643d9c5f42629dc7f6" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e643d9c5f42629dc7f7" }, "plunkId" : "1s8CJmfEJf4PWMpwHJbZ", "webPath" : "/task/truncate/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e643d9c5f42629dc7f8" } }, { "content" : "describe(\"truncate\", function() {\n it(\"обрезает строку до указанной длины (включая троеточие)\", function() {\n assert.equal( \n truncate(\"Вот, что мне хотелось бы сказать на эту тему:\", 20),\n \"Вот, что мне хоте...\"\n );\n });\n\n it(\"не меняет короткие строки\", function() {\n assert.equal( \n truncate(\"Всем привет!\", 20), \n \"Всем привет!\"\n );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e643d9c5f42629dc7f9" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e653d9c5f42629dc7fd" }, "plunkId" : "79dIQmsLcAFO2xVk4ZXb", "webPath" : "/task/get-week-day/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e653d9c5f42629dc7fe" } }, { "content" : "describe(\"getWeekDay\", function() {\n it(\"3 января 2014 - пятница\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 3)), 'пт');\n });\n\n it(\"4 января 2014 - суббота\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 4)), 'сб');\n });\n\n it(\"5 января 2014 - воскресенье\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 5)), 'вс');\n });\n\n it(\"6 января 2014 - понедельник\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 6)), 'пн');\n });\n\n it(\"7 января 2014 - вторник\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 7)), 'вт');\n });\n\n it(\"8 января 2014 - среда\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 8)), 'ср');\n });\n\n it(\"9 января 2014 - четверг\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 9)), 'чт');\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e653d9c5f42629dc7ff" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e653d9c5f42629dc800" }, "plunkId" : "i6h1s1tI8OOUR1UUalJ9", "webPath" : "/task/get-week-day/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e653d9c5f42629dc801" } }, { "content" : "describe(\"getWeekDay\", function() {\n it(\"3 января 2014 - пятница\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 3)), 'пт');\n });\n\n it(\"4 января 2014 - суббота\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 4)), 'сб');\n });\n\n it(\"5 января 2014 - воскресенье\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 5)), 'вс');\n });\n\n it(\"6 января 2014 - понедельник\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 6)), 'пн');\n });\n\n it(\"7 января 2014 - вторник\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 7)), 'вт');\n });\n\n it(\"8 января 2014 - среда\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 8)), 'ср');\n });\n\n it(\"9 января 2014 - четверг\", function() {\n assert.equal( getWeekDay(new Date(2014, 0, 9)), 'чт');\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e653d9c5f42629dc802" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e663d9c5f42629dc804" }, "plunkId" : "Gbf53BeZYAXapCksLprY", "webPath" : "/task/weekday/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e663d9c5f42629dc805" } }, { "content" : "describe(\"getLocalDay возвращает день недели\", function() {\n it(\"3 января 2014 - пятница\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 3)), 5);\n });\n\n it(\"4 января 2014 - суббота\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 4)), 6);\n });\n\n it(\"5 января 2014 - воскресенье\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 5)), 7);\n });\n\n it(\"6 января 2014 - понедельник\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 6)), 1);\n });\n\n it(\"7 января 2014 - вторник\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 7)), 2);\n });\n\n it(\"8 января 2014 - среда\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 8)), 3);\n });\n\n it(\"9 января 2014 - четверг\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 9)), 4);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e663d9c5f42629dc806" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e663d9c5f42629dc807" }, "plunkId" : "rZLyconQXkbHKj17Znop", "webPath" : "/task/weekday/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e663d9c5f42629dc808" } }, { "content" : "describe(\"getLocalDay возвращает день недели\", function() {\n it(\"3 января 2014 - пятница\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 3)), 5);\n });\n\n it(\"4 января 2014 - суббота\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 4)), 6);\n });\n\n it(\"5 января 2014 - воскресенье\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 5)), 7);\n });\n\n it(\"6 января 2014 - понедельник\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 6)), 1);\n });\n\n it(\"7 января 2014 - вторник\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 7)), 2);\n });\n\n it(\"8 января 2014 - среда\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 8)), 3);\n });\n\n it(\"9 января 2014 - четверг\", function() {\n assert.equal( getLocalDay(new Date(2014, 0, 9)), 4);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e663d9c5f42629dc809" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e673d9c5f42629dc80b" }, "plunkId" : "yXqT0amz31dzec7fUvnO", "webPath" : "/task/get-date-ago/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e673d9c5f42629dc80c" } }, { "content" : "describe(\"getDateAgo\", function() {\n\n it(\"1 день до 02.01.2015 -> число 1\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 1), 1 );\n });\n\n\n it(\"2 день до 02.01.2015 -> число 31\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 2), 31 );\n });\n\n it(\"100 дней от 02.01.2015 -> число 24\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 100), 24 );\n });\n\n it(\"365 дней от 02.01.2015 -> число 2\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 365), 2 );\n });\n\n it(\"не меняет переданный объект Date\", function() {\n var date = new Date(2015, 0, 2);\n var dateCopy = new Date(date);\n getDateAgo(dateCopy, 100);\n assert.equal(date.getTime(), dateCopy.getTime());\n });\n \n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e673d9c5f42629dc80d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e673d9c5f42629dc80e" }, "plunkId" : "0H3qm2gHyvKjYiQjHWRA", "webPath" : "/task/get-date-ago/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e673d9c5f42629dc80f" } }, { "content" : "describe(\"getDateAgo\", function() {\n\n it(\"1 день до 02.01.2015 -> число 1\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 1), 1 );\n });\n\n\n it(\"2 день до 02.01.2015 -> число 31\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 2), 31 );\n });\n\n it(\"100 дней от 02.01.2015 -> число 24\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 100), 24 );\n });\n\n it(\"365 дней от 02.01.2015 -> число 2\", function() {\n assert.equal( getDateAgo(new Date(2015, 0, 2), 365), 2 );\n });\n\n it(\"не меняет переданный объект Date\", function() {\n var date = new Date(2015, 0, 2);\n var dateCopy = new Date(date);\n getDateAgo(dateCopy, 100);\n assert.equal(date.getTime(), dateCopy.getTime());\n });\n \n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e673d9c5f42629dc810" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e683d9c5f42629dc812" }, "plunkId" : "YqPiBvUKYmJqfXFHLoi4", "webPath" : "/task/last-day-of-month/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e683d9c5f42629dc813" } }, { "content" : "describe(\"getLastDayOfMonth\", function() {\n it(\"последний день 01.01.2012 - 31\", function() {\n assert.equal( getLastDayOfMonth(2012, 0), 31);\n });\n\n it(\"последний день 01.02.2012 - 29 (високосный год)\", function() {\n assert.equal( getLastDayOfMonth(2012, 1), 29);\n });\n\n it(\"последний день 01.02.2013 - 28\", function() {\n assert.equal( getLastDayOfMonth(2013, 1), 28);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e683d9c5f42629dc814" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e683d9c5f42629dc815" }, "plunkId" : "BzvwlONZgGiG2zbC8t6H", "webPath" : "/task/last-day-of-month/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e683d9c5f42629dc816" } }, { "content" : "describe(\"getLastDayOfMonth\", function() {\n it(\"последний день 01.01.2012 - 31\", function() {\n assert.equal( getLastDayOfMonth(2012, 0), 31);\n });\n\n it(\"последний день 01.02.2012 - 29 (високосный год)\", function() {\n assert.equal( getLastDayOfMonth(2012, 1), 29);\n });\n\n it(\"последний день 01.02.2013 - 28\", function() {\n assert.equal( getLastDayOfMonth(2013, 1), 28);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e683d9c5f42629dc817" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e693d9c5f42629dc81b" }, "plunkId" : "aUn6h5xf1vYEJOiynshy", "webPath" : "/task/format-date-ddmmyy/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e693d9c5f42629dc81c" } }, { "content" : "describe(\"formatDate\", function() {\n it(\"правильно форматирует дату 30.01.14\", function() {\n assert.equal( formatDate(new Date(2014, 0, 30)), '30.01.14');\n });\n\n it(\"правильно форматирует дату 01.01.01\", function() {\n assert.equal( formatDate(new Date(2001, 0, 1)), '01.01.01');\n });\n\n it(\"правильно форматирует дату 01.01.00\", function() {\n assert.equal( formatDate(new Date(2000, 0, 1)), '01.01.00');\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e693d9c5f42629dc81d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e693d9c5f42629dc81e" }, "plunkId" : "g3X13HUxGNi4V8fxE53O", "webPath" : "/task/format-date-ddmmyy/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e693d9c5f42629dc81f" } }, { "content" : "describe(\"formatDate\", function() {\n it(\"правильно форматирует дату 30.01.14\", function() {\n assert.equal( formatDate(new Date(2014, 0, 30)), '30.01.14');\n });\n\n it(\"правильно форматирует дату 01.01.01\", function() {\n assert.equal( formatDate(new Date(2001, 0, 1)), '01.01.01');\n });\n\n it(\"правильно форматирует дату 01.01.00\", function() {\n assert.equal( formatDate(new Date(2000, 0, 1)), '01.01.00');\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e693d9c5f42629dc820" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6a3d9c5f42629dc822" }, "plunkId" : "QmfhELJPHziYuIRZA4gw", "webPath" : "/task/format-date-relative/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6a3d9c5f42629dc823" } }, { "content" : "describe(\"formatDate\", function() {\n it(\"выводит дату 1мс назад как \\\"только что\\\"\", function() {\n assert.equal( formatDate( new Date(new Date - 1) ), 'только что' );\n });\n\n it('выводит дату \"30 сек назад\"', function() {\n assert.equal( formatDate( new Date( new Date - 30*1000) ), \"30 сек. назад\" );\n });\n\n it('выводит дату \"5 мин назад\"', function() {\n assert.equal( formatDate( new Date( new Date- 5*60*1000) ), \"5 мин. назад\");\n });\n\n it(\"выводит старую дату в формате дд.мм.гг чч:мм\", function() {\n assert.equal( formatDate( new Date(2014, 2, 1, 11, 22, 33) ), \"01.03.14 11:22\" ); \n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6a3d9c5f42629dc824" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6a3d9c5f42629dc825" }, "plunkId" : "OOTgHu0DV8LWLhhh1GzA", "webPath" : "/task/format-date-relative/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6a3d9c5f42629dc826" } }, { "content" : "describe(\"formatDate\", function() {\n it(\"выводит дату 1мс назад как \\\"только что\\\"\", function() {\n assert.equal( formatDate( new Date(new Date - 1) ), 'только что' );\n });\n\n it('выводит дату \"30 сек назад\"', function() {\n assert.equal( formatDate( new Date( new Date - 30*1000) ), \"30 сек. назад\" );\n });\n\n it('выводит дату \"5 мин назад\"', function() {\n assert.equal( formatDate( new Date( new Date- 5*60*1000) ), \"5 мин. назад\");\n });\n\n it(\"выводит старую дату в формате дд.мм.гг чч:мм\", function() {\n assert.equal( formatDate( new Date(2014, 2, 1, 11, 22, 33) ), \"01.03.14 11:22\" ); \n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6a3d9c5f42629dc827" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6b3d9c5f42629dc82b" }, "plunkId" : "jFa5l6NKkD8MXrRdJaoI", "webPath" : "/task/format-date-polymorphic/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6b3d9c5f42629dc82c" } }, { "content" : "describe(\"formatDate\", function() {\n it(\"читает дату вида гггг-мм-дд из строки\", function() {\n assert.equal( formatDate( '2011-10-02' ), \"02.10.11\" );\n });\n\n it(\"читает дату из числа 1234567890 (миллисекунды)\", function() {\n assert.equal( formatDate( 1234567890 ), \"14.02.09\" );\n });\n\n it(\"читает дату из массива вида [гггг, м, д]\", function() {\n assert.equal( formatDate( [2014,0,1] ), \"01.01.14\" );\n });\n\n it(\"читает дату из объекта Date\", function() {\n assert.equal( formatDate( new Date(2014,0,1) ), \"01.01.14\" );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6b3d9c5f42629dc82d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6b3d9c5f42629dc82e" }, "plunkId" : "TTFftn9YQmipt42maHLX", "webPath" : "/task/format-date-polymorphic/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6b3d9c5f42629dc82f" } }, { "content" : "describe(\"formatDate\", function() {\n it(\"читает дату вида гггг-мм-дд из строки\", function() {\n assert.equal( formatDate( '2011-10-02' ), \"02.10.11\" );\n });\n\n it(\"читает дату из числа 1234567890 (миллисекунды)\", function() {\n assert.equal( formatDate( 1234567890 ), \"14.02.09\" );\n });\n\n it(\"читает дату из массива вида [гггг, м, д]\", function() {\n assert.equal( formatDate( [2014,0,1] ), \"01.01.14\" );\n });\n\n it(\"читает дату из объекта Date\", function() {\n assert.equal( formatDate( new Date(2014,0,1) ), \"01.01.14\" );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6b3d9c5f42629dc830" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6c3d9c5f42629dc837" }, "plunkId" : "HpDkbJqXmhyOugpLB5VD", "webPath" : "/task/get-decimal/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6c3d9c5f42629dc838" } }, { "content" : "describe(\"getDecimal\", function() {\n it(\"возвращает дробную часть 1.2 как 0.2\", function() {\n assert.equal( getDecimal(1.2), 0.2 );\n });\n\n it(\"возвращает дробную часть 1.3 как 0.3\", function() {\n assert.equal( getDecimal(1.3), 0.3 );\n });\n\n it(\"возвращает дробную часть 12.345 как 0.345\", function() {\n assert.equal( getDecimal(12.345), 0.345 );\n });\n\n it(\"возвращает дробную часть -1.2 как 0.2\", function() {\n assert.equal( getDecimal(-1.2), 0.2 );\n });\n\n it(\"возвращает дробную часть 5 как 0\", function() {\n assert.equal( getDecimal(5), 0 );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6c3d9c5f42629dc839" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6c3d9c5f42629dc83a" }, "plunkId" : "4qIfGhDOJkltlGRXCf1O", "webPath" : "/task/get-decimal/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6c3d9c5f42629dc83b" } }, { "content" : "describe(\"getDecimal\", function() {\n it(\"возвращает дробную часть 1.2 как 0.2\", function() {\n assert.equal( getDecimal(1.2), 0.2 );\n });\n\n it(\"возвращает дробную часть 1.3 как 0.3\", function() {\n assert.equal( getDecimal(1.3), 0.3 );\n });\n\n it(\"возвращает дробную часть 12.345 как 0.345\", function() {\n assert.equal( getDecimal(12.345), 0.345 );\n });\n\n it(\"возвращает дробную часть -1.2 как 0.2\", function() {\n assert.equal( getDecimal(-1.2), 0.2 );\n });\n\n it(\"возвращает дробную часть 5 как 0\", function() {\n assert.equal( getDecimal(5), 0 );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6c3d9c5f42629dc83c" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6d3d9c5f42629dc845" }, "plunkId" : "7n8GZ3xMghAcuayaRpXg", "webPath" : "/task/is-empty/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6d3d9c5f42629dc846" } }, { "content" : "describe(\"isEmpty\", function() {\n it(\"если объект пустой - возвращает true\", function() {\n assert.isTrue( isEmpty({}) );\n });\n\n it(\"если у объекта есть любое свойство, не важно какое - возвращает false\", function() {\n assert.isFalse( isEmpty({ anything: false }) );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6d3d9c5f42629dc847" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6e3d9c5f42629dc848" }, "plunkId" : "ptCc3QWpUle9qoEcPPEK", "webPath" : "/task/is-empty/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6e3d9c5f42629dc849" } }, { "content" : "describe(\"isEmpty\", function() {\n it(\"если объект пустой - возвращает true\", function() {\n assert.isTrue( isEmpty({}) );\n });\n\n it(\"если у объекта есть любое свойство, не важно какое - возвращает false\", function() {\n assert.isFalse( isEmpty({ anything: false }) );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6e3d9c5f42629dc84a" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6e3d9c5f42629dc84e" }, "plunkId" : "4XmeP8ttSiKc5eadP7xs", "webPath" : "/task/multiply-numeric/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6e3d9c5f42629dc84f" } }, { "content" : "describe(\"multiplyNumeric\", function() {\n it(\"умножает численные свойства на 2\", function() {\n var menu = {\n width: 200,\n height: \"300\",\n title: \"Моё меню\"\n };\n multiplyNumeric(menu);\n assert.equal( menu.width, 400 );\n assert.equal( menu.height, 600 );\n assert.equal( menu.title, \"Моё меню\" );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6e3d9c5f42629dc850" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6f3d9c5f42629dc851" }, "plunkId" : "i4fP21JxnMGlDkAcWPsG", "webPath" : "/task/multiply-numeric/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6f3d9c5f42629dc852" } }, { "content" : "describe(\"multiplyNumeric\", function() {\n it(\"умножает численные свойства на 2\", function() {\n var menu = {\n width: 200,\n height: \"300\",\n title: \"Моё меню\"\n };\n multiplyNumeric(menu);\n assert.equal( menu.width, 400 );\n assert.equal( menu.height, 600 );\n assert.equal( menu.title, \"Моё меню\" );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6f3d9c5f42629dc853" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e6f3d9c5f42629dc859" }, "plunkId" : "B3uKuotFYiB5ep47cEiG", "webPath" : "/task/maximal-subarray/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e6f3d9c5f42629dc85a" } }, { "content" : "describe(\"getMaxSubSum\", function() {\n it(\"максимальная подсумма [1, 2, 3] равна 6\", function() {\n assert.equal( getMaxSubSum([1, 2, 3]), 6);\n });\n\n it(\"максимальная подсумма [-1, 2, 3, -9] равна 5\", function() {\n assert.equal( getMaxSubSum([-1, 2, 3, -9]), 5);\n });\n\n it(\"максимальная подсумма [-1, 2, 3, -9, 11] равна 11\", function() {\n assert.equal( getMaxSubSum([-1, 2, 3, -9, 11]), 11);\n });\n\n it(\"максимальная подсумма [-2, -1, 1, 2] равна 3\", function() {\n assert.equal( getMaxSubSum([-2, -1, 1, 2]), 3);\n });\n\n it(\"максимальная подсумма [100, -9, 2, -3, 5] равна 100\", function() {\n assert.equal( getMaxSubSum([100, -9, 2, -3, 5]), 100);\n });\n\n it(\"максимальная подсумма [] равна 0\", function() {\n assert.equal( getMaxSubSum([]), 0);\n });\n\n it(\"максимальная подсумма [-1] равна 0\", function() {\n assert.equal( getMaxSubSum([-1]), 0);\n });\n\n it(\"максимальная подсумма [-1, -2] равна 0\", function() {\n assert.equal( getMaxSubSum([-1, -2]), 0);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e6f3d9c5f42629dc85b" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e703d9c5f42629dc85c" }, "plunkId" : "Ln6kNvNo65yfacYNuwZa", "webPath" : "/task/maximal-subarray/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e703d9c5f42629dc85d" } }, { "content" : "describe(\"getMaxSubSum\", function() {\n it(\"максимальная подсумма [1, 2, 3] равна 6\", function() {\n assert.equal( getMaxSubSum([1, 2, 3]), 6);\n });\n\n it(\"максимальная подсумма [-1, 2, 3, -9] равна 5\", function() {\n assert.equal( getMaxSubSum([-1, 2, 3, -9]), 5);\n });\n\n it(\"максимальная подсумма [-1, 2, 3, -9, 11] равна 11\", function() {\n assert.equal( getMaxSubSum([-1, 2, 3, -9, 11]), 11);\n });\n\n it(\"максимальная подсумма [-2, -1, 1, 2] равна 3\", function() {\n assert.equal( getMaxSubSum([-2, -1, 1, 2]), 3);\n });\n\n it(\"максимальная подсумма [100, -9, 2, -3, 5] равна 100\", function() {\n assert.equal( getMaxSubSum([100, -9, 2, -3, 5]), 100);\n });\n\n it(\"максимальная подсумма [] равна 0\", function() {\n assert.equal( getMaxSubSum([]), 0);\n });\n\n it(\"максимальная подсумма [-1] равна 0\", function() {\n assert.equal( getMaxSubSum([-1]), 0);\n });\n\n it(\"максимальная подсумма [-1, -2] равна 0\", function() {\n assert.equal( getMaxSubSum([-1, -2]), 0);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e703d9c5f42629dc85e" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e703d9c5f42629dc865" }, "plunkId" : "7aZkYFV3P56vwRKr0XX4", "webPath" : "/task/array-find/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e703d9c5f42629dc866" } }, { "content" : "describe(\"find\", function() {\n\n describe(\"возвращает позицию, на которой найден элемент\", function() {\n it(\"в массиве [1,2,3] находит 1 на позиции 0\", function() {\n assert.equal( find([1, 2, 3], 1), 0);\n });\n it(\"в массиве [1,2,3] находит 2 на позиции 1\", function() {\n assert.equal( find([1, 2, 3], 2), 1);\n }); \n it(\"в массиве [1,2,3] находит 3 на позиции 2\", function() {\n assert.equal( find([1, 2, 3], 3), 2);\n });\n });\n\n it(\"если элемент не найден, возвращает -1\", function() {\n assert.equal( find([1,2,3], 0), -1);\n });\n\n it(\"отличает false или null от 0\", function() {\n assert.equal( find([false, true, null], 0), -1);\n });\n\n it(\"отличает 1 от true\", function() {\n assert.equal( find([1, 2, 3], true), -1);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e703d9c5f42629dc867" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e713d9c5f42629dc868" }, "plunkId" : "YcCGccDcOHGH3ZEfo6Fo", "webPath" : "/task/array-find/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e713d9c5f42629dc869" } }, { "content" : "describe(\"find\", function() {\n\n describe(\"возвращает позицию, на которой найден элемент\", function() {\n it(\"в массиве [1,2,3] находит 1 на позиции 0\", function() {\n assert.equal( find([1, 2, 3], 1), 0);\n });\n it(\"в массиве [1,2,3] находит 2 на позиции 1\", function() {\n assert.equal( find([1, 2, 3], 2), 1);\n }); \n it(\"в массиве [1,2,3] находит 3 на позиции 2\", function() {\n assert.equal( find([1, 2, 3], 3), 2);\n });\n });\n\n it(\"если элемент не найден, возвращает -1\", function() {\n assert.equal( find([1,2,3], 0), -1);\n });\n\n it(\"отличает false или null от 0\", function() {\n assert.equal( find([false, true, null], 0), -1);\n });\n\n it(\"отличает 1 от true\", function() {\n assert.equal( find([1, 2, 3], true), -1);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e713d9c5f42629dc86a" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e713d9c5f42629dc86c" }, "plunkId" : "AB0fh17msp15bh53U2lY", "webPath" : "/task/filter-range/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e713d9c5f42629dc86d" } }, { "content" : "describe(\"filterRange\", function() {\n it(\"не меняет исходный массив\", function() {\n var arr = [5, 4, 3, 8, 0];\n \n filterRange(arr, 0, 10);\n assert.deepEqual(arr, [5,4,3,8,0]);\n });\n\n it(\"оставляет только значения указанного интервала\", function() {\n var arr = [5, 4, 3, 8, 0];\n \n var result = filterRange(arr, 3, 5);\n assert.deepEqual(result, [5,4,3]);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e713d9c5f42629dc86e" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e723d9c5f42629dc86f" }, "plunkId" : "QGhNUZvEIzfXDxxVVoRk", "webPath" : "/task/filter-range/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e723d9c5f42629dc870" } }, { "content" : "describe(\"filterRange\", function() {\n it(\"не меняет исходный массив\", function() {\n var arr = [5, 4, 3, 8, 0];\n \n filterRange(arr, 0, 10);\n assert.deepEqual(arr, [5,4,3,8,0]);\n });\n\n it(\"оставляет только значения указанного интервала\", function() {\n var arr = [5, 4, 3, 8, 0];\n \n var result = filterRange(arr, 3, 5);\n assert.deepEqual(result, [5,4,3]);\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e723d9c5f42629dc871" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e733d9c5f42629dc875" }, "plunkId" : "RKhkhnsFcKsGD9ieIZ9v", "webPath" : "/task/add-class/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e733d9c5f42629dc876" } }, { "content" : "describe(\"addClass\", function() {\n\n it(\"добавляет класс, которого нет\", function() {\n var obj = { className: 'open menu' };\n addClass(obj, 'new');\n assert.deepEqual(obj, {\n className: 'open menu new'\n });\n });\n\n it(\"не добавляет класс, который уже есть\", function() {\n var obj = { className: 'open menu' };\n addClass(obj, 'open');\n assert.deepEqual(obj, {\n className: 'open menu'\n });\n });\n\n it(\"не добавляет лишних пробелов, который уже есть\", function() {\n var obj = { className: '' };\n addClass(obj, 'open');\n assert.deepEqual(obj, {\n className: 'open'\n });\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e733d9c5f42629dc877" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e733d9c5f42629dc878" }, "plunkId" : "ZfZ8d0eyxHbGcXHYGmw1", "webPath" : "/task/add-class/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e733d9c5f42629dc879" } }, { "content" : "describe(\"addClass\", function() {\n\n it(\"добавляет класс, которого нет\", function() {\n var obj = { className: 'open menu' };\n addClass(obj, 'new');\n assert.deepEqual(obj, {\n className: 'open menu new'\n });\n });\n\n it(\"не добавляет класс, который уже есть\", function() {\n var obj = { className: 'open menu' };\n addClass(obj, 'open');\n assert.deepEqual(obj, {\n className: 'open menu'\n });\n });\n\n it(\"не добавляет лишних пробелов, который уже есть\", function() {\n var obj = { className: '' };\n addClass(obj, 'open');\n assert.deepEqual(obj, {\n className: 'open'\n });\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e733d9c5f42629dc87a" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e743d9c5f42629dc87c" }, "plunkId" : "ZLaobLTZjSzcl6TLzSBg", "webPath" : "/task/filter-anagrams/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e743d9c5f42629dc87d" } }, { "content" : "describe(\"aclean\", function() {\n \n it(\"удаляет анаграммы\", function() {\n var arr = [\"воз\", \"киборг\", \"корсет\", \"зов\", \"гробик\", \"костер\", \"сектор\"];\n assert.sameMembers(aclean(arr), [\"гробик\", \"зов\", \"сектор\"]);\n });\n \n it(\"не различает регистр символов\", function() {\n var arr = [\"воз\", \"ЗОВ\"];\n assert.equal( aclean(arr).length, 1 );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e743d9c5f42629dc87e" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e743d9c5f42629dc87f" }, "plunkId" : "VTjhQvQQuiw5xPEUK8NZ", "webPath" : "/task/filter-anagrams/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e743d9c5f42629dc880" } }, { "content" : "describe(\"aclean\", function() {\n \n it(\"удаляет анаграммы\", function() {\n var arr = [\"воз\", \"киборг\", \"корсет\", \"зов\", \"гробик\", \"костер\", \"сектор\"];\n assert.sameMembers(aclean(arr), [\"гробик\", \"зов\", \"сектор\"]);\n });\n \n it(\"не различает регистр символов\", function() {\n var arr = [\"воз\", \"ЗОВ\"];\n assert.equal( aclean(arr).length, 1 );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e743d9c5f42629dc881" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e753d9c5f42629dc883" }, "plunkId" : "r49cGvEIVUplWjkB1oXa", "webPath" : "/task/array-unique/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e753d9c5f42629dc884" } }, { "content" : "describe(\"unique\", function() {\n it(\"убирает неуникальные элементы из массива\", function() {\n var strings = [\"кришна\", \"кришна\", \"харе\", \"харе\", \n \"харе\", \"харе\", \"кришна\", \"кришна\", \"8-()\"];\n\n assert.deepEqual( unique(strings), [\"кришна\", \"харе\", \"8-()\"] ); \n });\n\n it(\"не изменяет исходный массив\", function() {\n var strings = [\"кришна\", \"кришна\", \"харе\", \"харе\"];\n unique(strings);\n assert.deepEqual( strings, [\"кришна\", \"кришна\", \"харе\", \"харе\"] ); \n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e753d9c5f42629dc885" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e753d9c5f42629dc886" }, "plunkId" : "hvAtIPXhMmSiPyzWb767", "webPath" : "/task/array-unique/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e753d9c5f42629dc887" } }, { "content" : "describe(\"unique\", function() {\n it(\"убирает неуникальные элементы из массива\", function() {\n var strings = [\"кришна\", \"кришна\", \"харе\", \"харе\", \n \"харе\", \"харе\", \"кришна\", \"кришна\", \"8-()\"];\n\n assert.deepEqual( unique(strings), [\"кришна\", \"харе\", \"8-()\"] ); \n });\n\n it(\"не изменяет исходный массив\", function() {\n var strings = [\"кришна\", \"кришна\", \"харе\", \"харе\"];\n unique(strings);\n assert.deepEqual( strings, [\"кришна\", \"кришна\", \"харе\", \"харе\"] ); \n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e753d9c5f42629dc888" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e763d9c5f42629dc88a" }, "plunkId" : "ZPXmH8bB4HsfOBc1tmth", "webPath" : "/task/camelcase/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e763d9c5f42629dc88b" } }, { "content" : "describe(\"camelize\", function() {\n\n it(\"оставляет пустую строку \\\"как есть\\\"\", function() {\n assert.equal( camelize(\"\"), \"\");\n });\n\n describe(\"делает заглавным первый символ после дефиса\", function() {\n\n it(\"превращает background-color в backgroundColor\", function() {\n assert.equal( camelize(\"background-color\"), \"backgroundColor\");\n });\n\n it(\"превращает list-style-image в listStyleImage\", function() {\n assert.equal( camelize(\"list-style-image\"), \"listStyleImage\");\n });\n\n it(\"превращает -webkit-transition в WebkitTransition\", function() {\n assert.equal( camelize(\"-webkit-transition\"), \"WebkitTransition\");\n });\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e763d9c5f42629dc88c" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e763d9c5f42629dc88d" }, "plunkId" : "Qt44xIRbNlxaUFT0ntg6", "webPath" : "/task/camelcase/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e763d9c5f42629dc88e" } }, { "content" : "describe(\"camelize\", function() {\n\n it(\"оставляет пустую строку \\\"как есть\\\"\", function() {\n assert.equal( camelize(\"\"), \"\");\n });\n\n describe(\"делает заглавным первый символ после дефиса\", function() {\n\n it(\"превращает background-color в backgroundColor\", function() {\n assert.equal( camelize(\"background-color\"), \"backgroundColor\");\n });\n\n it(\"превращает list-style-image в listStyleImage\", function() {\n assert.equal( camelize(\"list-style-image\"), \"listStyleImage\");\n });\n\n it(\"превращает -webkit-transition в WebkitTransition\", function() {\n assert.equal( camelize(\"-webkit-transition\"), \"WebkitTransition\");\n });\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e763d9c5f42629dc88f" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e773d9c5f42629dc891" }, "plunkId" : "HEqZf7YYwKyKrUzagq22", "webPath" : "/task/remove-class/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e773d9c5f42629dc892" } }, { "content" : "describe(\"removeClass\", function() {\n\n it(\"ничего не делает, если класса нет\", function() {\n var obj = { className: 'open menu' };\n removeClass(obj, 'new');\n assert.deepEqual(obj, {\n className: 'open menu'\n });\n });\n\n it(\"не меняет пустое свойство\", function() {\n var obj = { className: '' };\n removeClass(obj, 'new');\n assert.deepEqual(obj, {\n className: \"\"\n });\n });\n\n it(\"удаляет класс, не оставляя лишних пробелов\", function() {\n var obj = { className: 'open menu' };\n removeClass(obj, 'open');\n assert.deepEqual(obj, {\n className: \"menu\"\n });\n });\n\n it(\"если класс один и он удалён, то результат - пустая строка\", function() {\n var obj = { className: \"menu\" };\n removeClass(obj, 'menu');\n assert.deepEqual(obj, {\n className: \"\"\n });\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e773d9c5f42629dc893" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e773d9c5f42629dc894" }, "plunkId" : "aQcbhmsPjxVN1P7iYrvy", "webPath" : "/task/remove-class/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e773d9c5f42629dc895" } }, { "content" : "describe(\"removeClass\", function() {\n\n it(\"ничего не делает, если класса нет\", function() {\n var obj = { className: 'open menu' };\n removeClass(obj, 'new');\n assert.deepEqual(obj, {\n className: 'open menu'\n });\n });\n\n it(\"не меняет пустое свойство\", function() {\n var obj = { className: '' };\n removeClass(obj, 'new');\n assert.deepEqual(obj, {\n className: \"\"\n });\n });\n\n it(\"удаляет класс, не оставляя лишних пробелов\", function() {\n var obj = { className: 'open menu' };\n removeClass(obj, 'open');\n assert.deepEqual(obj, {\n className: \"menu\"\n });\n });\n\n it(\"если класс один и он удалён, то результат - пустая строка\", function() {\n var obj = { className: \"menu\" };\n removeClass(obj, 'menu');\n assert.deepEqual(obj, {\n className: \"\"\n });\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e773d9c5f42629dc896" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e773d9c5f42629dc898" }, "plunkId" : "lNSn6JNblYIjm4hIkSvG", "webPath" : "/task/filter-in-place/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e773d9c5f42629dc899" } }, { "content" : "describe(\"filterRangeInPlace\", function() {\n\n it(\"меняет массив, оставляя только значения из диапазона\", function() {\n var arr = [5, 3, 8, 1];\n filterRangeInPlace(arr, 1, 4);\n assert.deepEqual(arr, [3, 1]);\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e773d9c5f42629dc89a" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e783d9c5f42629dc89b" }, "plunkId" : "qkDdAG6KAV9KnH2ip2CR", "webPath" : "/task/filter-in-place/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e783d9c5f42629dc89c" } }, { "content" : "describe(\"filterRangeInPlace\", function() {\n\n it(\"меняет массив, оставляя только значения из диапазона\", function() {\n var arr = [5, 3, 8, 1];\n filterRangeInPlace(arr, 1, 4);\n assert.deepEqual(arr, [3, 1]);\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e783d9c5f42629dc89d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e793d9c5f42629dc8a6" }, "plunkId" : "2wE4liWD4rxVOG2hHHb8", "webPath" : "/task/partial-sums-array/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e793d9c5f42629dc8a7" } }, { "content" : "describe(\"getSums\", function() {\n\n it(\"частичные суммы [1,2,3,4,5] равны [1,3,6,10,15]\", function() {\n assert.deepEqual( getSums([1,2,3,4,5]), [1,3,6,10,15]);\n });\n\n it(\"частичные суммы [-2,-1,0,1] равны [-2,-3,-3,-2]\", function() {\n assert.deepEqual( getSums([-2,-1,0,1]), [-2,-3,-3,-2]);\n });\n\n it(\"частичные суммы [] равны []\", function() {\n assert.deepEqual( getSums([]), [] );\n });\n\n it(\"частичные суммы [1] равны [1]\", function() {\n assert.deepEqual( getSums([1]), [1] );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e793d9c5f42629dc8a8" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e793d9c5f42629dc8a9" }, "plunkId" : "DBub0F7uZCp0ysGrNsJP", "webPath" : "/task/partial-sums-array/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e793d9c5f42629dc8aa" } }, { "content" : "describe(\"getSums\", function() {\n\n it(\"частичные суммы [1,2,3,4,5] равны [1,3,6,10,15]\", function() {\n assert.deepEqual( getSums([1,2,3,4,5]), [1,3,6,10,15]);\n });\n\n it(\"частичные суммы [-2,-1,0,1] равны [-2,-3,-3,-2]\", function() {\n assert.deepEqual( getSums([-2,-1,0,1]), [-2,-3,-3,-2]);\n });\n\n it(\"частичные суммы [] равны []\", function() {\n assert.deepEqual( getSums([]), [] );\n });\n\n it(\"частичные суммы [1] равны [1]\", function() {\n assert.deepEqual( getSums([1]), [1] );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e793d9c5f42629dc8ab" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7a3d9c5f42629dc8c1" }, "plunkId" : "0WEJ9dGjfwOLEGUPQ7IR", "webPath" : "/article/closures-module/highlight-conflict", "files" : [ { "filename" : "highlight.js", "content" : "// глобальная переменная нашего скрипта\nvar message = \"Привет\";\n\n// функция для вывода этой переменной\nfunction showMessage() {\n alert(message);\n}\n\n// выводим сообщение\nshowMessage();\n", "_id" : { "$oid" : "54a04e7a3d9c5f42629dc8c2" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n\n\n\nКнопка \n\n\n\n \n\n", "_id" : { "$oid" : "54a04e7a3d9c5f42629dc8c3" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7b3d9c5f42629dc8c4" }, "plunkId" : "ykMYOesriav3fJ1oIHOe", "webPath" : "/article/closures-module/highlight-module", "files" : [ { "filename" : "highlight.js", "content" : "(function() {\n \n // глобальная переменная нашего скрипта\n var message = \"Привет\";\n\n // функция для вывода этой переменной\n function showMessage() {\n alert(message);\n }\n\n // выводим сообщение\n showMessage();\n\n})();", "_id" : { "$oid" : "54a04e7b3d9c5f42629dc8c5" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n\n\n\nКнопка \n\n\n\n \n\n", "_id" : { "$oid" : "54a04e7b3d9c5f42629dc8c6" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7b3d9c5f42629dc8ca" }, "plunkId" : "jlXXWg4tP1SA3WqasHdA", "webPath" : "/task/stringbuffer/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7b3d9c5f42629dc8cb" } }, { "content" : "var buffer;\nbeforeEach(function() {\n buffer = makeBuffer();\n});\n\nit(\"возвращает пустую строку по умолчанию\", function() {\n assert.strictEqual( buffer(), \"\");\n});\n\nit(\"добавляет аргументы в буффер\", function() {\n buffer('Замыкания'); \n buffer(' Использовать'); \n buffer(' Нужно!'); \n assert.equal( buffer(), 'Замыкания Использовать Нужно!');\n});\n\nit(\"приводит всё к строке\", function() {\n buffer(null);\n buffer(false);\n assert.equal( buffer(), \"nullfalse\");\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7b3d9c5f42629dc8cc" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7c3d9c5f42629dc8cd" }, "plunkId" : "rCAqyDvd70PSqQThohHn", "webPath" : "/task/stringbuffer/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7c3d9c5f42629dc8ce" } }, { "content" : "var buffer;\nbeforeEach(function() {\n buffer = makeBuffer();\n});\n\nit(\"возвращает пустую строку по умолчанию\", function() {\n assert.strictEqual( buffer(), \"\");\n});\n\nit(\"добавляет аргументы в буффер\", function() {\n buffer('Замыкания'); \n buffer(' Использовать'); \n buffer(' Нужно!'); \n assert.equal( buffer(), 'Замыкания Использовать Нужно!');\n});\n\nit(\"приводит всё к строке\", function() {\n buffer(null);\n buffer(false);\n assert.equal( buffer(), \"nullfalse\");\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7c3d9c5f42629dc8cf" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7d3d9c5f42629dc8d1" }, "plunkId" : "UngttGuBXXFiUdveoXgX", "webPath" : "/task/stringbuffer-with-clear/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7d3d9c5f42629dc8d2" } }, { "content" : "var buffer;\n\nbeforeEach(function() {\n buffer = makeBuffer();\n});\n\nit(\"возвращает пустую строку по умолчанию\", function() {\n assert.strictEqual( buffer(), \"\");\n});\n\nit(\"добавляет аргументы в буффер\", function() {\n buffer('Замыкания'); \n buffer(' Использовать'); \n buffer(' Нужно!'); \n assert.equal( buffer(), 'Замыкания Использовать Нужно!');\n});\n\nit(\"приводит всё к строке\", function() {\n buffer(null);\n buffer(false);\n assert.equal( buffer(), \"nullfalse\");\n});\n\nit(\"очищает буфер вызовом clear\", function() {\n buffer(\"test\");\n buffer.clear();\n buffer(\"первый\");\n buffer(\"второй\");\n assert.equal( buffer(), \"первыйвторой\");\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7d3d9c5f42629dc8d3" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7d3d9c5f42629dc8d4" }, "plunkId" : "ZHSYTxyooHdk8q8rByDb", "webPath" : "/task/stringbuffer-with-clear/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7d3d9c5f42629dc8d5" } }, { "content" : "var buffer;\n\nbeforeEach(function() {\n buffer = makeBuffer();\n});\n\nit(\"возвращает пустую строку по умолчанию\", function() {\n assert.strictEqual( buffer(), \"\");\n});\n\nit(\"добавляет аргументы в буффер\", function() {\n buffer('Замыкания'); \n buffer(' Использовать'); \n buffer(' Нужно!'); \n assert.equal( buffer(), 'Замыкания Использовать Нужно!');\n});\n\nit(\"приводит всё к строке\", function() {\n buffer(null);\n buffer(false);\n assert.equal( buffer(), \"nullfalse\");\n});\n\nit(\"очищает буфер вызовом clear\", function() {\n buffer(\"test\");\n buffer.clear();\n buffer(\"первый\");\n buffer(\"второй\");\n assert.equal( buffer(), \"первыйвторой\");\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7d3d9c5f42629dc8d6" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8d9" }, "plunkId" : "cT40OTvAX7zbEPtc6oPX", "webPath" : "/task/filter-through-function/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8da" } }, { "content" : "var arr;\n\nbefore(function() {\n arr = [1, 2, 3, 4, 5, 6, 7];\n});\n\ndescribe(\"inArray\", function() {\n var checkInArr;\n\n before(function() {\n checkInArr = inArray(arr);\n });\n \n it(\"возвращает фильтр для значений в массиве\", function() {\n assert.isTrue( checkInArr(5) );\n assert.isFalse( checkInArr(0) );\n });\n});\n\n\ndescribe(\"inBetween\", function() {\n var checkBetween36;\n\n before(function() {\n checkBetween36 = inBetween(3, 6);\n });\n\n it(\"возвращает фильтрa для значений в промежутке\", function() {\n assert.isTrue( checkBetween36(5) );\n assert.isFalse( checkBetween36(0) );\n });\n});\n\n\ndescribe(\"filter\", function() {\n\n it(\"фильтрует через func\", function() {\n assert.deepEqual( filter(arr, function(a) { return a % 2 == 0; }), [2,4,6] ); \n });\n\n it(\"не модифицирует исходный массив\", function() {\n filter(arr, function(a) { return a % 2 == 0; });\n assert.deepEqual( arr, [1, 2, 3, 4, 5, 6, 7] ); \n });\n\n it(\"поддерживает фильтр inBetween\", function() {\n assert.deepEqual( filter(arr,inBetween(3,6)), [3,4,5,6]);\n });\n\n it(\"поддерживает фильтр inArray\", function() {\n assert.deepEqual( filter(arr, inArray([1,2,3])), [1,2,3]);\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8db" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8dc" }, "plunkId" : "kgsgL8ROAKccGGLn9VQR", "webPath" : "/task/filter-through-function/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8dd" } }, { "content" : "var arr;\n\nbefore(function() {\n arr = [1, 2, 3, 4, 5, 6, 7];\n});\n\ndescribe(\"inArray\", function() {\n var checkInArr;\n\n before(function() {\n checkInArr = inArray(arr);\n });\n \n it(\"возвращает фильтр для значений в массиве\", function() {\n assert.isTrue( checkInArr(5) );\n assert.isFalse( checkInArr(0) );\n });\n});\n\n\ndescribe(\"inBetween\", function() {\n var checkBetween36;\n\n before(function() {\n checkBetween36 = inBetween(3, 6);\n });\n\n it(\"возвращает фильтрa для значений в промежутке\", function() {\n assert.isTrue( checkBetween36(5) );\n assert.isFalse( checkBetween36(0) );\n });\n});\n\n\ndescribe(\"filter\", function() {\n\n it(\"фильтрует через func\", function() {\n assert.deepEqual( filter(arr, function(a) { return a % 2 == 0; }), [2,4,6] ); \n });\n\n it(\"не модифицирует исходный массив\", function() {\n filter(arr, function(a) { return a % 2 == 0; });\n assert.deepEqual( arr, [1, 2, 3, 4, 5, 6, 7] ); \n });\n\n it(\"поддерживает фильтр inBetween\", function() {\n assert.deepEqual( filter(arr,inBetween(3,6)), [3,4,5,6]);\n });\n\n it(\"поддерживает фильтр inArray\", function() {\n assert.deepEqual( filter(arr, inArray([1,2,3])), [1,2,3]);\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8de" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8e0" }, "plunkId" : "4HMOnyruEP6dILbkJC8z", "webPath" : "/task/make-army/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8e1" } }, { "content" : "var army;\nbefore(function() {\n army = makeArmy();\n window.alert = sinon.stub(window, \"alert\");\n});\n\nit(\"army[0] выводит 0\", function() {\n army[0]();\n assert(alert.calledWith(0));\n});\n\n\nit(\"army[5] функция выводит 5\", function() {\n army[5]();\n assert(alert.calledWith(5));\n});\n\nafter(function() {\n window.alert.restore();\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7e3d9c5f42629dc8e2" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e7f3d9c5f42629dc8e3" }, "plunkId" : "XqqPBbYATGs2BI3xN5nD", "webPath" : "/task/make-army/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e7f3d9c5f42629dc8e4" } }, { "content" : "var army;\nbefore(function() {\n army = makeArmy();\n window.alert = sinon.stub(window, \"alert\");\n});\n\nit(\"army[0] выводит 0\", function() {\n army[0]();\n assert(alert.calledWith(0));\n});\n\n\nit(\"army[5] функция выводит 5\", function() {\n army[5]();\n assert(alert.calledWith(5));\n});\n\nafter(function() {\n window.alert.restore();\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e7f3d9c5f42629dc8e5" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e803d9c5f42629dc8f3" }, "plunkId" : "iRr40EZakYsKonr6aijE", "webPath" : "/task/calculator/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e803d9c5f42629dc8f4" } }, { "content" : "sinon.stub(window, \"prompt\");\n\nprompt.onCall(0).returns(\"2\");\nprompt.onCall(1).returns(\"3\");\n\ndescribe(\"calculator\", function() {\n before(function() {\n calculator.read();\n });\n\n it(\"при вводе 2 и 3 сумма равна 5\", function() {\n assert.equal( calculator.sum(), 5 );\n });\n\n it(\"при вводе 2 и 3 произведение равно 6\", function() {\n assert.equal( calculator.mul(), 6 );\n });\n});\n\nafter(function() {\n prompt.restore();\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e803d9c5f42629dc8f5" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e803d9c5f42629dc8f6" }, "plunkId" : "OCAISSlXQ5p4WDSuiVsn", "webPath" : "/task/calculator/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e803d9c5f42629dc8f7" } }, { "content" : "sinon.stub(window, \"prompt\");\n\nprompt.onCall(0).returns(\"2\");\nprompt.onCall(1).returns(\"3\");\n\ndescribe(\"calculator\", function() {\n before(function() {\n calculator.read();\n });\n\n it(\"при вводе 2 и 3 сумма равна 5\", function() {\n assert.equal( calculator.sum(), 5 );\n });\n\n it(\"при вводе 2 и 3 произведение равно 6\", function() {\n assert.equal( calculator.mul(), 6 );\n });\n});\n\nafter(function() {\n prompt.restore();\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e803d9c5f42629dc8f8" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e813d9c5f42629dc8fd" }, "plunkId" : "awfJEv9PsgSm9iVtpnlt", "webPath" : "/task/calculator-constructor/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e813d9c5f42629dc8fe" } }, { "content" : "sinon.stub(window, \"prompt\")\n\nprompt.onCall(0).returns(\"2\");\nprompt.onCall(1).returns(\"3\");\n\ndescribe(\"calculator\", function() {\n var calculator;\n before(function() {\n calculator = new Calculator();\n calculator.read();\n });\n\n it(\"при вводе 2 и 3 сумма равна 5\", function() {\n assert.equal( calculator.sum(), 5 );\n });\n\n it(\"при вводе 2 и 3 произведение равно 6\", function() {\n assert.equal( calculator.mul(), 6 );\n });\n\n});\n\nafter(function() {\n prompt.restore();\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e813d9c5f42629dc8ff" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e813d9c5f42629dc900" }, "plunkId" : "2KoyCpvU3IODvuhInwOd", "webPath" : "/task/calculator-constructor/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e813d9c5f42629dc901" } }, { "content" : "sinon.stub(window, \"prompt\")\n\nprompt.onCall(0).returns(\"2\");\nprompt.onCall(1).returns(\"3\");\n\ndescribe(\"calculator\", function() {\n var calculator;\n before(function() {\n calculator = new Calculator();\n calculator.read();\n });\n\n it(\"при вводе 2 и 3 сумма равна 5\", function() {\n assert.equal( calculator.sum(), 5 );\n });\n\n it(\"при вводе 2 и 3 произведение равно 6\", function() {\n assert.equal( calculator.mul(), 6 );\n });\n\n});\n\nafter(function() {\n prompt.restore();\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e813d9c5f42629dc902" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e823d9c5f42629dc904" }, "plunkId" : "p7z2GgAM1F28GzYHbDCc", "webPath" : "/task/accumulator/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e823d9c5f42629dc905" } }, { "content" : "describe(\"Accumulator(1)\", function() {\n var accumulator;\n before(function() {\n accumulator = new Accumulator(1);\n });\n\n beforeEach(function() {\n sinon.stub(window, \"prompt\")\n });\n\n afterEach(function() {\n prompt.restore();\n });\n\n it(\"начальное значение 1\", function() {\n assert.equal( accumulator.value, 1 );\n });\n\n it(\"после ввода 0 значение 1\", function() {\n prompt.returns(\"0\");\n accumulator.read();\n assert.equal( accumulator.value, 1 );\n });\n\n it(\"после ввода 1 значение 2\", function() {\n prompt.returns(\"1\");\n accumulator.read();\n assert.equal( accumulator.value, 2 );\n });\n\n it(\"после ввода 2 значение 4\", function() {\n prompt.returns(\"2\");\n accumulator.read();\n assert.equal( accumulator.value, 4 );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e823d9c5f42629dc906" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e823d9c5f42629dc907" }, "plunkId" : "9nNp7zx0EpAG1GWD8mxv", "webPath" : "/task/accumulator/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e823d9c5f42629dc908" } }, { "content" : "describe(\"Accumulator(1)\", function() {\n var accumulator;\n before(function() {\n accumulator = new Accumulator(1);\n });\n\n beforeEach(function() {\n sinon.stub(window, \"prompt\")\n });\n\n afterEach(function() {\n prompt.restore();\n });\n\n it(\"начальное значение 1\", function() {\n assert.equal( accumulator.value, 1 );\n });\n\n it(\"после ввода 0 значение 1\", function() {\n prompt.returns(\"0\");\n accumulator.read();\n assert.equal( accumulator.value, 1 );\n });\n\n it(\"после ввода 1 значение 2\", function() {\n prompt.returns(\"1\");\n accumulator.read();\n assert.equal( accumulator.value, 2 );\n });\n\n it(\"после ввода 2 значение 4\", function() {\n prompt.returns(\"2\");\n accumulator.read();\n assert.equal( accumulator.value, 4 );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e823d9c5f42629dc909" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e833d9c5f42629dc90b" }, "plunkId" : "Ww0Qq8A6eySWJBk5T1jY", "webPath" : "/task/calculator-extendable/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e833d9c5f42629dc90c" } }, { "content" : "var calculator;\nbefore(function() {\n calculator = new Calculator;\n});\n\nit(\"calculate(12 + 34) = 46\", function() {\n assert.equal( calculator.calculate(\"12 + 34\"), 46 );\n});\n\nit(\"calculate(34 - 12) = 22\", function() {\n assert.equal( calculator.calculate(\"34 - 12\"), 22 );\n});\n\nit(\"добавили умножение: calculate(2 * 3) = 6\", function() {\n calculator.addMethod(\"*\", function(a, b) {\n return a * b;\n });\n assert.equal( calculator.calculate(\"2 * 3\"), 6 );\n});\n\nit(\"добавили возведение в степень: calculate(2 ** 3) = 8\", function() {\n calculator.addMethod(\"**\", function(a, b) {\n return Math.pow(a, b);\n });\n assert.equal( calculator.calculate(\"2 ** 3\"), 8 );\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e833d9c5f42629dc90d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e833d9c5f42629dc90e" }, "plunkId" : "uwgBAN1yeHlAXMXjTlRm", "webPath" : "/task/calculator-extendable/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e833d9c5f42629dc90f" } }, { "content" : "var calculator;\nbefore(function() {\n calculator = new Calculator;\n});\n\nit(\"calculate(12 + 34) = 46\", function() {\n assert.equal( calculator.calculate(\"12 + 34\"), 46 );\n});\n\nit(\"calculate(34 - 12) = 22\", function() {\n assert.equal( calculator.calculate(\"34 - 12\"), 22 );\n});\n\nit(\"добавили умножение: calculate(2 * 3) = 6\", function() {\n calculator.addMethod(\"*\", function(a, b) {\n return a * b;\n });\n assert.equal( calculator.calculate(\"2 * 3\"), 6 );\n});\n\nit(\"добавили возведение в степень: calculate(2 ** 3) = 8\", function() {\n calculator.addMethod(\"**\", function(a, b) {\n return Math.pow(a, b);\n });\n assert.equal( calculator.calculate(\"2 ** 3\"), 8 );\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e833d9c5f42629dc910" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e853d9c5f42629dc913" }, "plunkId" : "YCVp7ndpycBGaLMbSLIM", "webPath" : "/task/objects-counter/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e853d9c5f42629dc914" } }, { "content" : "describe(\"Article.showStats\", function() {\n before(function() {\n sinon.stub(window, \"alert\");\n this.clock = sinon.useFakeTimers();\n });\n \n after(function() {\n window.alert.restore();\n this.clock.restore();\n });\n\n it(\"Выводит число статей и дату создания последней\", function() {\n new Article();\n this.clock.tick(100);\n new Article();\n Article.showStats(); \n \n assert( alert.calledWith('Всего: 2, Последняя: ' + new Date() ) );\n });\n\n it(\"и ещё одна статья...\", function() {\n this.clock.tick(100);\n new Article();\n Article.showStats();\n\n assert( alert.calledWith('Всего: 3, Последняя: ' + new Date() ) );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e853d9c5f42629dc915" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e853d9c5f42629dc916" }, "plunkId" : "fYPhtkJEdaeetYms2bmz", "webPath" : "/task/objects-counter/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e853d9c5f42629dc917" } }, { "content" : "describe(\"Article.showStats\", function() {\n before(function() {\n sinon.stub(window, \"alert\");\n this.clock = sinon.useFakeTimers();\n });\n \n after(function() {\n window.alert.restore();\n this.clock.restore();\n });\n\n it(\"Выводит число статей и дату создания последней\", function() {\n new Article();\n this.clock.tick(100);\n new Article();\n Article.showStats(); \n \n assert( alert.calledWith('Всего: 2, Последняя: ' + new Date() ) );\n });\n\n it(\"и ещё одна статья...\", function() {\n this.clock.tick(100);\n new Article();\n Article.showStats();\n\n assert( alert.calledWith('Всего: 3, Последняя: ' + new Date() ) );\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e853d9c5f42629dc918" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e863d9c5f42629dc91c" }, "plunkId" : "pP3x2GVWp5CpweJwioib", "webPath" : "/task/apply-function-skip-first-argument/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e863d9c5f42629dc91d" } }, { "content" : "describe(\"applyAll\", function() {\n\n it(\"применяет функцию ко всем аргументам, начиная со 2го\", function() {\n var min = applyAll(Math.min, 1, 2, 3);\n assert.equal( min, 1 );\n });\n\n it(\"при отсутствии аргументов просто вызывает функцию\", function() {\n var spy = sinon.spy();\n applyAll(spy);\n assert( spy.calledOnce );\n assert.equal( spy.firstCall.args.length, 0 );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e863d9c5f42629dc91e" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e863d9c5f42629dc91f" }, "plunkId" : "h8LHEHoN1GdUQBof2aqK", "webPath" : "/task/apply-function-skip-first-argument/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e863d9c5f42629dc920" } }, { "content" : "describe(\"applyAll\", function() {\n\n it(\"применяет функцию ко всем аргументам, начиная со 2го\", function() {\n var min = applyAll(Math.min, 1, 2, 3);\n assert.equal( min, 1 );\n });\n\n it(\"при отсутствии аргументов просто вызывает функцию\", function() {\n var spy = sinon.spy();\n applyAll(spy);\n assert( spy.calledOnce );\n assert.equal( spy.firstCall.args.length, 0 );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e863d9c5f42629dc921" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e873d9c5f42629dc92c" }, "plunkId" : "Vi55jo9NraEFpokxbVu7", "webPath" : "/task/logging-decorator/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e873d9c5f42629dc92d" } }, { "content" : "describe(\"makeLogging\", function() {\n it(\"записывает вызовы в массив log\", function() {\n var work = sinon.spy();\n\n var log = [];\n work = makeLogging(work, log);\n assert.deepEqual( log, []);\n\n work(1);\n assert.deepEqual( log, [1]);\n\n work(2);\n assert.deepEqual( log, [1, 2]);\n });\n\n it(\"передаёт вызов функции, возвращает её результат\", function() {\n var log = [];\n \n function work(x) {\n return x*2;\n }\n\n work = sinon.spy(work);\n var spy = work;\n work = makeLogging(work, log);\n \n assert.equal( work(1), 2 );\n assert(spy.calledWith(1));\n });\n \n\n it(\"сохраняет контекст вызова для методов объекта\", function() {\n var log = [];\n \n var calculator = {\n double: function(x) { return x*2; }\n }\n\n calculator.double = sinon.spy(calculator.double);\n var spy = calculator.double;\n calculator.double = makeLogging(calculator.double, log);\n\n assert.equal( calculator.double(1), 2 );\n assert(spy.calledWith(1));\n assert(spy.calledOn(calculator));\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e873d9c5f42629dc92e" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e873d9c5f42629dc92f" }, "plunkId" : "mq8t11R72o69Ig1uq2Y1", "webPath" : "/task/logging-decorator/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e873d9c5f42629dc930" } }, { "content" : "describe(\"makeLogging\", function() {\n it(\"записывает вызовы в массив log\", function() {\n var work = sinon.spy();\n\n var log = [];\n work = makeLogging(work, log);\n assert.deepEqual( log, []);\n\n work(1);\n assert.deepEqual( log, [1]);\n\n work(2);\n assert.deepEqual( log, [1, 2]);\n });\n\n it(\"передаёт вызов функции, возвращает её результат\", function() {\n var log = [];\n \n function work(x) {\n return x*2;\n }\n\n work = sinon.spy(work);\n var spy = work;\n work = makeLogging(work, log);\n \n assert.equal( work(1), 2 );\n assert(spy.calledWith(1));\n });\n \n\n it(\"сохраняет контекст вызова для методов объекта\", function() {\n var log = [];\n \n var calculator = {\n double: function(x) { return x*2; }\n }\n\n calculator.double = sinon.spy(calculator.double);\n var spy = calculator.double;\n calculator.double = makeLogging(calculator.double, log);\n\n assert.equal( calculator.double(1), 2 );\n assert(spy.calledWith(1));\n assert(spy.calledOn(calculator));\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e873d9c5f42629dc931" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e883d9c5f42629dc933" }, "plunkId" : "X15I2j4uh0V5R7jFFK8o", "webPath" : "/task/logging-decorator-arguments/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e883d9c5f42629dc934" } }, { "content" : "describe(\"makeLogging\", function() {\n it(\"записывает вызовы в массив log\", function() {\n var work = sinon.spy();\n\n var log = [];\n work = makeLogging(work, log);\n assert.deepEqual( log, []);\n\n work(1, 2);\n assert.deepEqual( log, [[1, 2]]);\n\n work(3, 4);\n assert.deepEqual( log, [[1, 2], [3,4]]);\n });\n\n it(\"передаёт вызов функции, возвращает её результат\", function() {\n var log = [];\n \n function sum(a, b) {\n return a + b;\n }\n\n sum = sinon.spy(sum);\n var spy = sum;\n sum = makeLogging(sum, log);\n \n assert.equal( sum(1, 2), 3 );\n assert(spy.calledWith(1, 2));\n });\n \n\n it(\"сохраняет контекст вызова для методов объекта\", function() {\n var log = [];\n \n var calculator = {\n sum: function(a, b) { return a + b; }\n }\n\n calculator.sum = sinon.spy(calculator.sum);\n var spy = calculator.sum;\n calculator.sum = makeLogging(calculator.sum, log);\n\n assert.equal( calculator.sum(1, 2), 3 );\n assert(spy.calledWith(1, 2));\n assert(spy.calledOn(calculator));\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e883d9c5f42629dc935" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e883d9c5f42629dc936" }, "plunkId" : "8pXVT8W5YXZJubJ8IXQ7", "webPath" : "/task/logging-decorator-arguments/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e883d9c5f42629dc937" } }, { "content" : "describe(\"makeLogging\", function() {\n it(\"записывает вызовы в массив log\", function() {\n var work = sinon.spy();\n\n var log = [];\n work = makeLogging(work, log);\n assert.deepEqual( log, []);\n\n work(1, 2);\n assert.deepEqual( log, [[1, 2]]);\n\n work(3, 4);\n assert.deepEqual( log, [[1, 2], [3,4]]);\n });\n\n it(\"передаёт вызов функции, возвращает её результат\", function() {\n var log = [];\n \n function sum(a, b) {\n return a + b;\n }\n\n sum = sinon.spy(sum);\n var spy = sum;\n sum = makeLogging(sum, log);\n \n assert.equal( sum(1, 2), 3 );\n assert(spy.calledWith(1, 2));\n });\n \n\n it(\"сохраняет контекст вызова для методов объекта\", function() {\n var log = [];\n \n var calculator = {\n sum: function(a, b) { return a + b; }\n }\n\n calculator.sum = sinon.spy(calculator.sum);\n var spy = calculator.sum;\n calculator.sum = makeLogging(calculator.sum, log);\n\n assert.equal( calculator.sum(1, 2), 3 );\n assert(spy.calledWith(1, 2));\n assert(spy.calledOn(calculator));\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e883d9c5f42629dc938" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e893d9c5f42629dc93a" }, "plunkId" : "MbdTkFNWdYYDsX7i1Tod", "webPath" : "/task/caching-decorator/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e893d9c5f42629dc93b" } }, { "content" : "describe(\"makeCaching\", function() {\n\n it(\"запоминает предыдущее значение функции с таким аргументом\", function() {\n function f(x) { \n return Math.random()*x; \n }\n\n f = makeCaching(f);\n\n var a = f(1);\n var b = f(1);\n assert.equal(a, b);\n \n var anotherValue = f(2); \n // почти наверняка другое значение\n assert.notEqual( a, anotherValue );\n });\n\n it(\"сохраняет контекст вызова\", function() {\n var obj = {\n spy: sinon.spy()\n };\n\n var spy = obj.spy;\n obj.spy = makeCaching(obj.spy);\n obj.spy(123);\n assert( spy.calledWith(123) );\n assert( spy.calledOn(obj) );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e893d9c5f42629dc93c" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e893d9c5f42629dc93d" }, "plunkId" : "TYJuE6RareyxoUvNKp3R", "webPath" : "/task/caching-decorator/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e893d9c5f42629dc93e" } }, { "content" : "describe(\"makeCaching\", function() {\n\n it(\"запоминает предыдущее значение функции с таким аргументом\", function() {\n function f(x) { \n return Math.random()*x; \n }\n\n f = makeCaching(f);\n\n var a = f(1);\n var b = f(1);\n assert.equal(a, b);\n \n var anotherValue = f(2); \n // почти наверняка другое значение\n assert.notEqual( a, anotherValue );\n });\n\n it(\"сохраняет контекст вызова\", function() {\n var obj = {\n spy: sinon.spy()\n };\n\n var spy = obj.spy;\n obj.spy = makeCaching(obj.spy);\n obj.spy(123);\n assert( spy.calledWith(123) );\n assert( spy.calledOn(obj) );\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e893d9c5f42629dc93f" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8a3d9c5f42629dc953" }, "plunkId" : "m1w2oujHDpETiFjTUeFi", "webPath" : "/task/delay/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e8a3d9c5f42629dc954" } }, { "content" : "describe(\"delay\", function() {\n before(function() {\n this.clock = sinon.useFakeTimers();\n });\n\n after(function() {\n this.clock.restore();\n });\n\n it(\"вызывает функцию через указанный таймаут\", function() {\n var start = Date.now();\n function f(x) {\n assert.equal(Date.now() - start, 1000);\n }\n f = sinon.spy(f);\n \n var f1000 = delay(f, 1000);\n f1000(\"test\");\n this.clock.tick(2000);\n assert(f.calledOnce, 'calledOnce check fails');\n });\n\n it(\"передаёт аргументы и контекст\", function() {\n var start = Date.now();\n var user = {\n sayHi: function(phrase, who) {\n assert.equal(this, user);\n assert.equal(phrase, \"Привет\");\n assert.equal(who, \"Вася\");\n assert.equal(Date.now() - start, 1500);\n }\n };\n \n user.sayHi = sinon.spy(user.sayHi);\n \n var spy = user.sayHi;\n user.sayHi = delay(user.sayHi, 1500);\n \n user.sayHi(\"Привет\", \"Вася\");\n \n this.clock.tick(2000);\n \n assert(spy.calledOnce, 'проверка calledOnce не сработала');\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e8a3d9c5f42629dc955" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8a3d9c5f42629dc956" }, "plunkId" : "a9WUD53suIwMqhBZqraV", "webPath" : "/task/delay/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e8a3d9c5f42629dc957" } }, { "content" : "describe(\"delay\", function() {\n before(function() {\n this.clock = sinon.useFakeTimers();\n });\n\n after(function() {\n this.clock.restore();\n });\n\n it(\"вызывает функцию через указанный таймаут\", function() {\n var start = Date.now();\n function f(x) {\n assert.equal(Date.now() - start, 1000);\n }\n f = sinon.spy(f);\n \n var f1000 = delay(f, 1000);\n f1000(\"test\");\n this.clock.tick(2000);\n assert(f.calledOnce, 'calledOnce check fails');\n });\n\n it(\"передаёт аргументы и контекст\", function() {\n var start = Date.now();\n var user = {\n sayHi: function(phrase, who) {\n assert.equal(this, user);\n assert.equal(phrase, \"Привет\");\n assert.equal(who, \"Вася\");\n assert.equal(Date.now() - start, 1500);\n }\n };\n \n user.sayHi = sinon.spy(user.sayHi);\n \n var spy = user.sayHi;\n user.sayHi = delay(user.sayHi, 1500);\n \n user.sayHi(\"Привет\", \"Вася\");\n \n this.clock.tick(2000);\n \n assert(spy.calledOnce, 'проверка calledOnce не сработала');\n });\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e8a3d9c5f42629dc958" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8b3d9c5f42629dc95a" }, "plunkId" : "D3K6y8sesHJi0N5OzzvE", "webPath" : "/task/debounce/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e8b3d9c5f42629dc95b" } }, { "content" : "describe(\"debounce\", function() {\n before(function() {\n this.clock = sinon.useFakeTimers();\n });\n \n after(function() {\n this.clock.restore();\n });\n\n it(\"вызывает функцию не чаще чем раз в ms миллисекунд\", function() {\n var log = '';\n function f(a) { log += a; }\n\n f = debounce(f, 1000);\n\n f(1); // выполнится сразу же\n f(2); // игнор\n\n setTimeout(function() { f(3) }, 100); // игнор (рановато)\n setTimeout(function() { f(4) }, 1100); // выполнится (таймаут прошёл)\n setTimeout(function() { f(5) }, 1500); // игнор\n\n this.clock.tick(5000);\n assert.equal(log, \"14\");\n });\n\n it(\"сохраняет контекст вызова\", function() {\n var obj = {\n f: function() { \n assert.equal(this, obj);\n }\n };\n \n obj.f = debounce(obj.f, 1000);\n obj.f(\"test\");\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e8b3d9c5f42629dc95c" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8b3d9c5f42629dc95d" }, "plunkId" : "XbwjUcZ4D7Nsuklvosbk", "webPath" : "/task/debounce/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e8b3d9c5f42629dc95e" } }, { "content" : "describe(\"debounce\", function() {\n before(function() {\n this.clock = sinon.useFakeTimers();\n });\n \n after(function() {\n this.clock.restore();\n });\n\n it(\"вызывает функцию не чаще чем раз в ms миллисекунд\", function() {\n var log = '';\n function f(a) { log += a; }\n\n f = debounce(f, 1000);\n\n f(1); // выполнится сразу же\n f(2); // игнор\n\n setTimeout(function() { f(3) }, 100); // игнор (рановато)\n setTimeout(function() { f(4) }, 1100); // выполнится (таймаут прошёл)\n setTimeout(function() { f(5) }, 1500); // игнор\n\n this.clock.tick(5000);\n assert.equal(log, \"14\");\n });\n\n it(\"сохраняет контекст вызова\", function() {\n var obj = {\n f: function() { \n assert.equal(this, obj);\n }\n };\n \n obj.f = debounce(obj.f, 1000);\n obj.f(\"test\");\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e8b3d9c5f42629dc95f" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8b3d9c5f42629dc961" }, "plunkId" : "Ieb11C1UipUdZ3Nw4iZN", "webPath" : "/task/throttle/source", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e8b3d9c5f42629dc962" } }, { "content" : "describe(\"throttle(f, 1000)\", function() {\n var f1000;\n var log = \"\";\n function f(a) { log += a; } \n\n before(function() {\n f1000 = throttle(f, 1000);\n this.clock = sinon.useFakeTimers();\n });\n\n it(\"первый вызов срабатывает тут же\", function() {\n f1000(1); // такой вызов должен сработать тут же\n assert.equal(log, \"1\");\n });\n\n it(\"тормозит второе срабатывание до 1000мс\", function() {\n f1000(2); // (тормозим, не прошло 1000мс)\n f1000(3); // (тормозим, не прошло 1000мс)\n // через 1000 мс запланирован вызов с последним аргументом \n\n assert.equal(log, \"1\"); // пока что сработал только первый вызов\n \n this.clock.tick(1000); // прошло 1000мс времени\n assert.equal(log, \"13\"); // log==13, т.к. сработал вызов f1000(3)\n });\n\n it(\"тормозит третье срабатывание до 1000мс после второго\", function() {\n this.clock.tick(100);\n f1000(4); // (тормозим, с последнего вызова прошло 100мс - менее 1000мс)\n this.clock.tick(100);\n f1000(5); // (тормозим, с последнего вызова прошло 200мс - менее 1000мс)\n this.clock.tick(700);\n f1000(6); // (тормозим, с последнего вызова прошло 900мс - менее 1000мс)\n \n this.clock.tick(100); // сработал вызов с 6\n\n assert.equal(log, \"136\");\n });\n\n after(function() {\n this.clock.restore();\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e8b3d9c5f42629dc963" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8c3d9c5f42629dc964" }, "plunkId" : "ciJEoCDf4tKE56uGlItF", "webPath" : "/task/throttle/solution", "files" : [ { "content" : "\n\n\n \n \n \n\n\n\n \n\n\n", "filename" : "index.html", "_id" : { "$oid" : "54a04e8c3d9c5f42629dc965" } }, { "content" : "describe(\"throttle(f, 1000)\", function() {\n var f1000;\n var log = \"\";\n function f(a) { log += a; } \n\n before(function() {\n f1000 = throttle(f, 1000);\n this.clock = sinon.useFakeTimers();\n });\n\n it(\"первый вызов срабатывает тут же\", function() {\n f1000(1); // такой вызов должен сработать тут же\n assert.equal(log, \"1\");\n });\n\n it(\"тормозит второе срабатывание до 1000мс\", function() {\n f1000(2); // (тормозим, не прошло 1000мс)\n f1000(3); // (тормозим, не прошло 1000мс)\n // через 1000 мс запланирован вызов с последним аргументом \n\n assert.equal(log, \"1\"); // пока что сработал только первый вызов\n \n this.clock.tick(1000); // прошло 1000мс времени\n assert.equal(log, \"13\"); // log==13, т.к. сработал вызов f1000(3)\n });\n\n it(\"тормозит третье срабатывание до 1000мс после второго\", function() {\n this.clock.tick(100);\n f1000(4); // (тормозим, с последнего вызова прошло 100мс - менее 1000мс)\n this.clock.tick(100);\n f1000(5); // (тормозим, с последнего вызова прошло 200мс - менее 1000мс)\n this.clock.tick(700);\n f1000(6); // (тормозим, с последнего вызова прошло 900мс - менее 1000мс)\n \n this.clock.tick(100); // сработал вызов с 6\n\n assert.equal(log, \"136\");\n });\n\n after(function() {\n this.clock.restore();\n });\n\n});", "filename" : "test.js", "_id" : { "$oid" : "54a04e8c3d9c5f42629dc966" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8c3d9c5f42629dc967" }, "plunkId" : "o6twCyMVoLMGuewIIjhl", "webPath" : "/article/setTimeout-setInterval/setInterval-anim", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n\n \n \n\n\n\n\n\n", "_id" : { "$oid" : "54a04e8c3d9c5f42629dc968" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8d3d9c5f42629dc97c" }, "plunkId" : "ly1wYzJ6BOYT1fXls8hI", "webPath" : "/task/coffeemachine-fix-run/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n \n\n\n\n", "_id" : { "$oid" : "54a04e8d3d9c5f42629dc97d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8e3d9c5f42629dc97e" }, "plunkId" : "NR84cNRbRCORB9ka7zFn", "webPath" : "/task/coffeemachine-fix-run/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n \n\n\n\n", "_id" : { "$oid" : "54a04e8e3d9c5f42629dc97f" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8e3d9c5f42629dc981" }, "plunkId" : "lJKvmFUQEsXnc1txscw5", "webPath" : "/task/coffeemachine-disable-stop/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n \n\n\n\n", "_id" : { "$oid" : "54a04e8e3d9c5f42629dc982" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e8f3d9c5f42629dc99b" }, "plunkId" : "QOwgyE72tuzrnYJCLz0c", "webPath" : "/task/clock-class/solution", "files" : [ { "filename" : "clock.js", "content" : "\nfunction Clock(options) {\n this._template = options.template;\n}\n\nClock.prototype._render = function render() {\n var date = new Date();\n\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n\n var output = this._template.replace('h', hours).replace('m', min).replace('s', sec);\n\n console.log(output);\n};\n\nClock.prototype.stop = function() {\n clearInterval(this._timer);\n};\n\nClock.prototype.start = function() {\n this._render();\n var self = this;\n this._timer = setInterval(function() {\n self._render();\n }, 1000);\n};\n", "_id" : { "$oid" : "54a04e8f3d9c5f42629dc99c" } }, { "filename" : "index.html", "content" : "\n\n\n Часики в консоли \n \n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e8f3d9c5f42629dc99d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e903d9c5f42629dc99e" }, "plunkId" : "xw5m88mWJaHLcHsQZxUN", "webPath" : "/task/clock-class/source", "files" : [ { "filename" : "clock.js", "content" : "function Clock(options) {\n\n var template = options.template;\n var timer;\n\n function render() {\n var date = new Date();\n\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n\n var output = template.replace('h', hours).replace('m', min).replace('s', sec);\n\n console.log(output);\n }\n\n this.stop = function() {\n clearInterval(timer);\n };\n\n this.start = function() {\n render();\n timer = setInterval(render, 1000);\n }\n\n}\n", "_id" : { "$oid" : "54a04e903d9c5f42629dc99f" } }, { "filename" : "index.html", "content" : "\n\n\n Часики в консоли \n \n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e903d9c5f42629dc9a0" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e913d9c5f42629dc9a2" }, "plunkId" : "33rUG97quIPP4iMAwMW7", "webPath" : "/task/clock-class-extended/solution", "files" : [ { "filename" : "clock.js", "content" : "\nfunction Clock(options) {\n this._template = options.template;\n}\n\nClock.prototype._render = function render() {\n var date = new Date();\n\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n\n var output = this._template.replace('h', hours).replace('m', min).replace('s', sec);\n\n console.log(output);\n};\n\nClock.prototype.stop = function() {\n clearInterval(this._timer);\n};\n\nClock.prototype.start = function() {\n this._render();\n var self = this;\n this._timer = setInterval(function() {\n self._render();\n }, 1000);\n};\n", "_id" : { "$oid" : "54a04e913d9c5f42629dc9a3" } }, { "filename" : "extended-clock.js", "content" : "\n\nfunction ExtendedClock(options) {\n Clock.apply(this, arguments);\n this._precision = +options.precision || 1000;\n}\n\nExtendedClock.prototype = Object.create(Clock.prototype);\n\nExtendedClock.prototype.start = function() {\n this._render();\n var self = this;\n this._timer = setInterval(function() {\n self._render();\n }, this._precision);\n};\n", "_id" : { "$oid" : "54a04e913d9c5f42629dc9a4" } }, { "filename" : "index.html", "content" : "\n\n\n Часики в консоли \n \n\n\n\n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e913d9c5f42629dc9a5" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e913d9c5f42629dc9a6" }, "plunkId" : "zoQyrJrQMFzVax3OkINV", "webPath" : "/task/clock-class-extended/source", "files" : [ { "filename" : "clock.js", "content" : "\nfunction Clock(options) {\n this._template = options.template;\n}\n\nClock.prototype._render = function render() {\n var date = new Date();\n\n var hours = date.getHours();\n if (hours < 10) hours = '0' + hours;\n\n var min = date.getMinutes();\n if (min < 10) min = '0' + min;\n\n var sec = date.getSeconds();\n if (sec < 10) sec = '0' + sec;\n\n var output = this._template.replace('h', hours).replace('m', min).replace('s', sec);\n\n console.log(output);\n};\n\nClock.prototype.stop = function() {\n clearInterval(this._timer);\n};\n\nClock.prototype.start = function() {\n this._render();\n var self = this;\n this._timer = setInterval(function() {\n self._render();\n }, 1000);\n};\n", "_id" : { "$oid" : "54a04e913d9c5f42629dc9a7" } }, { "filename" : "extended-clock.js", "content" : "function extend(Child, Parent) {\n Child.prototype = inherit(Parent.prototype);\n Child.prototype.constructor = Child;\n Child.parent = Parent.prototype;\n}\nfunction inherit(proto) {\n function F() {}\n F.prototype = proto;\n return new F;\n}\n\n// ваш код ", "_id" : { "$oid" : "54a04e913d9c5f42629dc9a8" } }, { "filename" : "index.html", "content" : "\n\n\n Часики в консоли \n \n\n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e913d9c5f42629dc9a9" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e923d9c5f42629dc9ab" }, "plunkId" : "tghdhdaq2pnt8f4piP51", "webPath" : "/task/menu-timer-animated/solution", "files" : [ { "filename" : "menu.js", "content" : "function Menu(state) {\n this._state = state || this.STATE_CLOSED;\n};\n\nMenu.prototype.STATE_OPEN = 1;\nMenu.prototype.STATE_CLOSED = 0;\n\nMenu.prototype.open = function() {\n this._state = this.STATE_OPEN;\n};\n\nMenu.prototype.close = function() {\n this._state = this.STATE_CLOSED;\n};\n\nMenu.prototype._stateAsString = function() {\n switch(this._state) {\n case this.STATE_OPEN:\n return 'открыто';\n\n case this.STATE_CLOSED:\n return 'закрыто';\n }\n};\n\nMenu.prototype.showState = function() {\n alert( this._stateAsString() );\n}", "_id" : { "$oid" : "54a04e923d9c5f42629dc9ac" } }, { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e923d9c5f42629dc9ad" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e923d9c5f42629dc9ae" }, "plunkId" : "pGP9a3ws5eBIgKIMOIN3", "webPath" : "/task/menu-timer-animated/source", "files" : [ { "filename" : "menu.js", "content" : "function Menu(state) {\n this._state = state || Menu.STATE_CLOSED;\n};\n\nMenu.STATE_OPEN = 1;\nMenu.STATE_CLOSED = 0;\n\nMenu.prototype.open = function() {\n this._state = Menu.STATE_OPEN;\n};\n\nMenu.prototype.close = function() {\n this._state = Menu.STATE_CLOSED;\n};\n\nMenu.prototype._stateAsString = function() {\n switch(this._state) {\n case Menu.STATE_OPEN:\n return 'открыто';\n\n case Menu.STATE_CLOSED:\n return 'закрыто';\n }\n};\n\nMenu.prototype.showState = function() {\n alert( this._stateAsString() );\n};", "_id" : { "$oid" : "54a04e923d9c5f42629dc9af" } }, { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e923d9c5f42629dc9b0" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e933d9c5f42629dc9c3" }, "plunkId" : "JsiCkXhOl63ZKUcZYxPL", "webPath" : "/task/clock-settimeout/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n \n\n\n\n\n\n hh :mm :ss \n
\n\n\n\n \n\n \n\n\n\n", "_id" : { "$oid" : "54a04e933d9c5f42629dc9c4" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e943d9c5f42629dc9c5" }, "plunkId" : "E9r02XaCK9LE2zXFkwWh", "webPath" : "/task/clock-settimeout/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n \n\n \n\n\n\n", "_id" : { "$oid" : "54a04e943d9c5f42629dc9c6" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e963d9c5f42629dc9cc" }, "plunkId" : "WBKXWgC9pLXv5nE5kIMi", "webPath" : "/task/create-list/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\nСоздание списка \n\n\n \n\n\n", "_id" : { "$oid" : "54a04e963d9c5f42629dc9cd" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e963d9c5f42629dc9cf" }, "plunkId" : "MUiVv1ChglS796V9sNGX", "webPath" : "/task/create-object-tree/build-tree-dom", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n
\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e963d9c5f42629dc9d0" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e973d9c5f42629dc9d1" }, "plunkId" : "Beq5Y42rlnUnuYsIloaz", "webPath" : "/task/create-object-tree/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n
\n\n\n\n \n", "_id" : { "$oid" : "54a04e973d9c5f42629dc9d2" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e973d9c5f42629dc9d3" }, "plunkId" : "QmHanHFbid9SIWJujNEA", "webPath" : "/task/create-object-tree/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n
\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e973d9c5f42629dc9d4" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e983d9c5f42629dc9d6" }, "plunkId" : "Vm8ljcgefMa5lYPsmPkA", "webPath" : "/task/calendar-table/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n \n\n\n\n\n
\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e983d9c5f42629dc9d7" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e993d9c5f42629dc9d8" }, "plunkId" : "c06MsRam3av1ni6zCTLg", "webPath" : "/task/calendar-table/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n \n\n\n\n\n
\n\n\n\n\n", "_id" : { "$oid" : "54a04e993d9c5f42629dc9d9" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e993d9c5f42629dc9db" }, "plunkId" : "icx3c4WqFZUhjmJG4t7g", "webPath" : "/task/clock-setinterval/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n \n\n\n\n\n\n hh :mm :ss \n
\n\n\n\n\n \n\n \n\n\n\n", "_id" : { "$oid" : "54a04e993d9c5f42629dc9dc" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9a3d9c5f42629dc9dd" }, "plunkId" : "SVFmBqj5Vq7jCEAn73vI", "webPath" : "/task/clock-setinterval/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n\n \n\n \n\n\n\n", "_id" : { "$oid" : "54a04e9a3d9c5f42629dc9de" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9a3d9c5f42629dc9e4" }, "plunkId" : "gScMGRSTDt3rFHkXGDL2", "webPath" : "/task/sort-table-performance/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n\n Алгоритм 1. \n\n Все TR
удалить из таблицы, при этом собрав их в JavaScript-массив. \n Отсортировать этот массив, используя свою функцию в sort(...)
для сравнения TR
\n Добавить TR
из массива в таблицу в нужном порядке \n \nПомерять время \n \n\n\n Алгоритм 2. \n\n Скопировать TR
в JavaScript-массив. \n Отсортировать этот массив, используя свою функцию в sort(...)
для сравнения TR
\n Добавить TR
из массива в таблицу в нужном порядке. При добавлении каждый TR
сам удалится с предыдущего места. \n \nПомерять время \n \n\n\n\n Алгоритм 3. \n\n Создать массив из объектов вида {elem: ссылка на TR, value: содержимое TR}
. \n Отсортировать массив по value
. Функция сравнения во время сортировки теперь будет обращаться не к innerHTML
, а к свойству объекта, это быстрее. Сортировка может потребовать многократных сравнений одного и того же элемента, отсюда выигрыш. \n Добавить TR
в таблицу в нужном порядке (автоудалятся с предыдущего места). \n \nПомерять время \n \n\n\n\n Алгоритм 4. \n \n Выполнить алгоритм 3, но перед этим удалить таблицу из документа, а после - вставить обратно. \n \nПомерять время \n \n\n\n Алгоритм 5. \n \n Замерить время генерации таблицы (создаётся строка и пишется в innerHTML
). \n \nПомерять время \n \n\n
\n\n\n\n\n\n\nСодержимое документа для придания \"реалистичности\" \n\n0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
\n\n\n\n\n", "_id" : { "$oid" : "54a04e9a3d9c5f42629dc9e5" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9c3d9c5f42629dc9e9" }, "plunkId" : "1omjHRegLYys7hna2gPE", "webPath" : "/task/round-button-javascript/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n \n\n\n\n Кнопка:\n \n
\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e9c3d9c5f42629dc9ea" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9c3d9c5f42629dc9eb" }, "plunkId" : "oTHuh7Q9n7kuX9f9pESj", "webPath" : "/task/round-button-javascript/source", "files" : [ { "filename" : "index.html", "content" : "\n\n \n\n\n\n Кнопка:\n \n
\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e9c3d9c5f42629dc9ec" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9d3d9c5f42629dc9ee" }, "plunkId" : "23aGd2hmJhW30QhCccOE", "webPath" : "/task/create-notification/solution", "files" : [ { "filename" : "index.css", "content" : ".notification {\n position: fixed;\n z-index: 1000;\n padding: 5px;\n border: 1px solid black;\n font: normal 20px Georgia;\n background: white;\n text-align: center;\n}\n\n.welcome {\n background: red;\n color: yellow;\n}\n\n", "_id" : { "$oid" : "54a04e9d3d9c5f42629dc9ef" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n Уведомление \n \n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorum aspernatur quam ex eaque inventore quod voluptatem adipisci omnis nemo nulla fugit iste numquam ducimus cumque minima porro ea quidem maxime necessitatibus beatae labore soluta voluptatum magnam consequatur sit laboriosam velit excepturi laborum sequi eos placeat et quia deleniti? Corrupti velit impedit autem et obcaecati fuga debitis nemo ratione iste veniam amet dicta hic ipsam unde cupiditate incidunt aut iure ipsum officiis soluta temporibus. Tempore dicta ullam delectus numquam consectetur quisquam explicabo culpa excepturi placeat quo sequi molestias reprehenderit hic at nemo cumque voluptates quidem repellendus maiores unde earum molestiae ad.\n
\n \n \n\n\n\n\n", "_id" : { "$oid" : "54a04e9d3d9c5f42629dc9f0" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9d3d9c5f42629dc9f1" }, "plunkId" : "lyGTQtY45ufNU7H8t17F", "webPath" : "/task/create-notification/source", "files" : [ { "filename" : "index.css", "content" : ".notification {\n position: fixed;\n z-index: 1000;\n padding: 5px;\n border: 1px solid black;\n font: normal 20px Georgia;\n background: white;\n text-align: center;\n}\n\n.welcome {\n background: red;\n color: yellow;\n}\n\n", "_id" : { "$oid" : "54a04e9d3d9c5f42629dc9f2" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n Уведомление \n \n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorum aspernatur quam ex eaque inventore quod voluptatem adipisci omnis nemo nulla fugit iste numquam ducimus cumque minima porro ea quidem maxime necessitatibus beatae labore soluta voluptatum magnam consequatur sit laboriosam velit excepturi laborum sequi eos placeat et quia deleniti? Corrupti velit impedit autem et obcaecati fuga debitis nemo ratione iste veniam amet dicta hic ipsam unde cupiditate incidunt aut iure ipsum officiis soluta temporibus. Tempore dicta ullam delectus numquam consectetur quisquam explicabo culpa excepturi placeat quo sequi molestias reprehenderit hic at nemo cumque voluptates quidem repellendus maiores unde earum molestiae ad.\n
\n \n В CSS есть готовый класс notification, который можно ставить уведомлению.
\n\n \n\n\n\n\n", "_id" : { "$oid" : "54a04e9d3d9c5f42629dc9f3" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9e3d9c5f42629dc9f8" }, "plunkId" : "eXTVqAH9tqYcKwG6QBJM", "webPath" : "/task/div-placeholder/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n\n\n\nBefore Before Before\n\n\nText Text Text \nText Text Text \n
\n\nAfter After After\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e9e3d9c5f42629dc9f9" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9e3d9c5f42629dc9fa" }, "plunkId" : "ZfOQ4JPzOErQqApXm5oh", "webPath" : "/task/div-placeholder/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n\n\n\nBefore Before Before\n\n\nText Text Text \nText Text Text \n
\n\nAfter After After\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e9e3d9c5f42629dc9fb" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9f3d9c5f42629dc9fd" }, "plunkId" : "iDuTzlXRM5xsK6u3qvhD", "webPath" : "/task/put-ball-in-center/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n\n\n\n\n\n
\n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \n
\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04e9f3d9c5f42629dc9fe" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04e9f3d9c5f42629dc9ff" }, "plunkId" : "trapvwIweopjmpei83E5", "webPath" : "/task/put-ball-in-center/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n\n\n\n\n\n
\n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \n
\n\n\n\n\n", "_id" : { "$oid" : "54a04e9f3d9c5f42629dca00" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea03d9c5f42629dca02" }, "plunkId" : "5vwuCiMBSZkDyuwzrKJv", "webPath" : "/task/expand-element/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n\n\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\n
\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04ea03d9c5f42629dca03" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea03d9c5f42629dca04" }, "plunkId" : "rxWbZTXrGyXus8Mv9QX6", "webPath" : "/task/expand-element/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n\n\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст текст текст\n
\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04ea03d9c5f42629dca05" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea23d9c5f42629dca07" }, "plunkId" : "ztyvofBCahZ6QwCDJqB6", "webPath" : "/article/metrics/cssWidthScroll", "files" : [ { "filename" : "index.html", "content" : "\n\n \n\n\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст\nтекст текст текст текст текст текст текст текст текст текст текст текст текст текст\n
\n\n\n\nУ элемента стоит style=\"width:300px\"
\n\nalert(width из getComputedStyle/currentStyle) \n\n\n\n", "_id" : { "$oid" : "54a04ea23d9c5f42629dca08" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea23d9c5f42629dca09" }, "plunkId" : "vicH0MU3ckSwkwrBL2r6", "webPath" : "/article/metrics/metric", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n \n \n\n\n\n\n\n\n
Introduction \n
This Ecma Standard is based on several originating technologies, the most well known being JavaScript (Netscape) and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in that company's Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers from Microsoft starting with Internet Explorer 3.0.
\n\n
The development of this Standard started in November 1996. The first edition of this Ecma Standard was adopted by the Ecma General Assembly of June 1997.
\n\n
That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international standard ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 approved the second edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the second edition are editorial in nature.
\n\n
The third edition of the Standard introduced powerful regular expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and minor changes in anticipation of forthcoming internationalisation facilities and future language growth. The third edition of the ECMAScript standard was adopted by the Ecma General Assembly of December 1999 and published as ISO/IEC 16262:2002 in June 2002.
\n\n
\n\n\nКоординаты мыши: ...
\n
\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04ea23d9c5f42629dca0a" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea23d9c5f42629dca13" }, "plunkId" : "RckIjV7Rt8GUXCbO17sm", "webPath" : "/task/find-point-coordinates/solution", "files" : [ { "filename" : "index.css", "content" : "body {\n padding: 20px 0 0 20px;\n cursor: pointer;\n}\n\n#field {\n overflow: hidden; \n width: 200px;\n height: 150px;\n border-top: 10px solid black;\n border-right: 10px solid gray;\n border-bottom: 10px solid gray;\n border-left: 10px solid black;\n background-color: #00FF00;\n font: 10px/1.2 monospace;\n}\n\n.triangle-right {\n position: relative;\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 20px solid red;\n text-indent: -20px;\n font: 12px/1 monospace;\n} \n", "_id" : { "$oid" : "54a04ea23d9c5f42629dca14" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n\n\n\n Кликните на любое место, чтобы получить координаты относительно окна. \n Это для удобства тестирования, чтобы проверить результат, который вы получите из DOM. \n (координаты появятся тут)
\n\n\n \n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n
\n\n\n 1
\n 3
\n 4
\n 2
\n\n\n \n\n\n\n", "_id" : { "$oid" : "54a04ea23d9c5f42629dca15" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea33d9c5f42629dca16" }, "plunkId" : "PAWKbZ5Fe9MxHO6Xdq43", "webPath" : "/task/find-point-coordinates/source", "files" : [ { "filename" : "index.css", "content" : "body {\n padding: 20px 0 0 20px;\n cursor: pointer;\n}\n\n#field {\n overflow: hidden; \n width: 200px;\n height: 150px;\n border-top: 10px solid black;\n border-right: 10px solid gray;\n border-bottom: 10px solid gray;\n border-left: 10px solid black;\n background-color: #00FF00;\n font: 10px/1.2 monospace;\n}\n\n.triangle-right {\n position: relative;\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 20px solid red;\n text-indent: -20px;\n font: 12px/1 monospace;\n} \n", "_id" : { "$oid" : "54a04ea33d9c5f42629dca17" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n\n\n\n Кликните на любое место, чтобы получить координаты относительно окна. \n Это для удобства тестирования, чтобы проверить результат, который вы получите из DOM. \n (координаты появятся тут)
\n\n\n \n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n
\n\n\n 1
\n 3
\n 4
\n 2
\n\n\n \n\n\n\n", "_id" : { "$oid" : "54a04ea33d9c5f42629dca18" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea33d9c5f42629dca1a" }, "plunkId" : "teijxdbm0IlAfEcGWMQO", "webPath" : "/task/position-at/solution", "files" : [ { "filename" : "index.css", "content" : ".note {\n position: fixed;\n z-index: 1000;\n padding: 5px;\n border: 1px solid black;\n background: white;\n text-align: center;\n font: italic 14px Georgia;\n}\n\nblockquote {\n background:#f9f9f9;\n border-left:10px solid #ccc;\n margin: 0 0 0 100px;\n padding:.5em 10px;\n quotes:\"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\";\n display: inline-block;\n white-space: pre;\n}\n\nblockquote:before {\n color: #ccc;\n content: open-quote;\n font-size:4em;\n line-height:.1em;\n margin-right:.25em;\n vertical-align:-.4em;\n}\n", "_id" : { "$oid" : "54a04ea33d9c5f42629dca1b" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit sint atque dolorum fuga ad incidunt voluptatum error fugiat animi amet! Odio temporibus nulla id unde quaerat dignissimos enim nisi rem provident molestias sit tempore omnis recusandae esse sequi officia sapiente.
\n \n \n \n- Что на завтрак, Бэрримор?\n- Овсянка, сэр.\n- А на обед?\n- Овсянка, сэр.\n- Ну а на ужин?\n- Котлеты, сэр.\n- Уррра!!!\n- Из овсянки, сэр!!!\n \n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit sint atque dolorum fuga ad incidunt voluptatum error fugiat animi amet! Odio temporibus nulla id unde quaerat dignissimos enim nisi rem provident molestias sit tempore omnis recusandae esse sequi officia sapiente.
\n \n \n \n\n\n\n\n", "_id" : { "$oid" : "54a04ea33d9c5f42629dca1c" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea43d9c5f42629dca1d" }, "plunkId" : "wWY9JL00csEFqTXEGGJx", "webPath" : "/task/position-at/source", "files" : [ { "filename" : "index.css", "content" : ".note {\n position: fixed;\n z-index: 1000;\n padding: 5px;\n border: 1px solid black;\n background: white;\n text-align: center;\n font: italic 14px Georgia;\n}\n\nblockquote {\n background:#f9f9f9;\n border-left:10px solid #ccc;\n margin: 0 0 0 100px;\n padding:.5em 10px;\n quotes:\"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\";\n display: inline-block;\n white-space: pre;\n}\n\nblockquote:before {\n color: #ccc;\n content: open-quote;\n font-size:4em;\n line-height:.1em;\n margin-right:.25em;\n vertical-align:-.4em;\n}\n", "_id" : { "$oid" : "54a04ea43d9c5f42629dca1e" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit sint atque dolorum fuga ad incidunt voluptatum error fugiat animi amet! Odio temporibus nulla id unde quaerat dignissimos enim nisi rem provident molestias sit tempore omnis recusandae esse sequi officia sapiente.
\n \n \n \n- Что на завтрак, Бэрримор?\n- Овсянка, сэр.\n- А на обед?\n- Овсянка, сэр.\n- Ну а на ужин?\n- Котлеты, сэр.\n- Уррра!!!\n- Из овсянки, сэр!!!\n \n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit sint atque dolorum fuga ad incidunt voluptatum error fugiat animi amet! Odio temporibus nulla id unde quaerat dignissimos enim nisi rem provident molestias sit tempore omnis recusandae esse sequi officia sapiente.
\n \n \n \n\n\n\n\n", "_id" : { "$oid" : "54a04ea43d9c5f42629dca1f" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea43d9c5f42629dca23" }, "plunkId" : "pin8LkA1uvgiTMmINuQT", "webPath" : "/task/position-at-absolute/solution", "files" : [ { "filename" : "index.css", "content" : ".note {\n position: absolute;\n z-index: 1000;\n padding: 5px;\n border: 1px solid black;\n background: white;\n text-align: center;\n font: italic 14px Georgia;\n}\n\nblockquote {\n background:#f9f9f9;\n border-left:10px solid #ccc;\n margin: 0 0 0 100px;\n padding:.5em 10px;\n quotes:\"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\";\n display: inline-block;\n white-space: pre;\n}\n\nblockquote:before {\n color: #ccc;\n content: open-quote;\n font-size:4em;\n line-height:.1em;\n margin-right:.25em;\n vertical-align:-.4em;\n}\n", "_id" : { "$oid" : "54a04ea43d9c5f42629dca24" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n Исправления два:
\n \n \n Использование функции getCoords()
из учебника для получения абсолютных координат. \n Изменение position:fixed
на position:absolute
в стилях. \n \n \n \n- Что на завтрак, Бэрримор?\n- Овсянка, сэр.\n- А на обед?\n- Овсянка, сэр.\n- Ну а на ужин?\n- Котлеты, сэр.\n- Уррра!!!\n- Из овсянки, сэр!!!\n \n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit sint atque dolorum fuga ad incidunt voluptatum error fugiat animi amet! Odio temporibus nulla id unde quaerat dignissimos enim nisi rem provident molestias sit tempore omnis recusandae esse sequi officia sapiente.
\n \n \n \n\n\n\n\n", "_id" : { "$oid" : "54a04ea43d9c5f42629dca25" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea43d9c5f42629dca27" }, "plunkId" : "NQBwqTzW4IkYbEjvBjOp", "webPath" : "/task/position-at-2/solution", "files" : [ { "filename" : "index.css", "content" : ".note {\n position: absolute;\n z-index: 1000;\n padding: 5px;\n border: 1px solid black;\n background: white;\n text-align: center;\n font: italic 14px Georgia;\n opacity: .8;\n}\n\nblockquote {\n background: #f9f9f9;\n border-left: 10px solid #ccc;\n margin: 0 0 0 100px;\n padding: .5em 10px;\n quotes: \"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\";\n display: inline-block;\n white-space: pre;\n}\n\nblockquote:before {\n color: #ccc;\n content: open-quote;\n font-size: 4em;\n line-height: .1em;\n margin-right: .25em;\n vertical-align: -.4em;\n}\n", "_id" : { "$oid" : "54a04ea43d9c5f42629dca28" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit sint atque dolorum fuga ad incidunt voluptatum error fugiat animi amet! Odio temporibus nulla id unde quaerat dignissimos enim nisi rem provident molestias sit tempore omnis recusandae esse sequi officia sapiente.
\n \n \n \n- Что на завтрак, Бэрримор?\n- Овсянка, сэр.\n- А на обед?\n- Овсянка, сэр.\n- Ну а на ужин?\n- Котлеты, сэр.\n- Уррра!!!\n- Из овсянки, сэр!!!\n \n \n Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reprehenderit sint atque dolorum fuga ad incidunt voluptatum error fugiat animi amet! Odio temporibus nulla id unde quaerat dignissimos enim nisi rem provident molestias sit tempore omnis recusandae esse sequi officia sapiente.
\n \n \n \n\n\n\n\n", "_id" : { "$oid" : "54a04ea43d9c5f42629dca29" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea53d9c5f42629dca32" }, "plunkId" : "IkhuvbaUiLBDsu0rxesC", "webPath" : "/task/dom-children/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n \n \n Пользователи:
\n \n\n \n\n \n\n \n\n", "_id" : { "$oid" : "54a04ea53d9c5f42629dca33" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea63d9c5f42629dca38" }, "plunkId" : "MRralhzAYACZeWbVtzny", "webPath" : "/task/select-diagonal-cells/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n 1:1 2:1 3:1 4:1 5:1 \n 1:2 2:2 3:2 4:2 5:2 \n 1:3 2:3 3:3 4:3 5:3 \n 1:4 2:4 3:4 4:4 5:4 \n 1:5 2:5 3:5 4:5 5:5 \n
\n \n\n\n", "_id" : { "$oid" : "54a04ea63d9c5f42629dca39" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea63d9c5f42629dca3a" }, "plunkId" : "ctqqTTueJl2k4KtZ2r9D", "webPath" : "/task/select-diagonal-cells/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n \n 1:1 2:1 3:1 4:1 5:1 \n 1:2 2:2 3:2 4:2 5:2 \n 1:3 2:3 3:3 4:3 5:3 \n 1:4 2:4 3:4 4:4 5:4 \n 1:5 2:5 3:5 4:5 5:5 \n
\n \n\n\n", "_id" : { "$oid" : "54a04ea63d9c5f42629dca3b" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea73d9c5f42629dca40" }, "plunkId" : "wXcwkKUa5C0joEWRj8BE", "webPath" : "/task/find-next-element/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\nПервый
\n\nВторой
\n\n\n\n\n", "_id" : { "$oid" : "54a04ea73d9c5f42629dca41" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea73d9c5f42629dca45" }, "plunkId" : "pvqckhe4nbltC8vPqJUH", "webPath" : "/task/get-user-attribute/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\n Выберите жанр
\n\n \n\n\n\n", "_id" : { "$oid" : "54a04ea73d9c5f42629dca46" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea83d9c5f42629dca4c" }, "plunkId" : "kdjnCi3dhTIKUpC51XEK", "webPath" : "/task/tree/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n \n\n\n\n Животные\n \n Млекопитающие\n \n Коровы \n Ослы \n Собаки \n Тигры \n \n \n Другие\n \n Змеи \n Птицы \n Ящерицы \n \n \n \n \n Рыбы\n \n Аквариумные\n \n\n \n Морские\n \n \n \n \n \n\n\n\n\n\n", "_id" : { "$oid" : "54a04ea83d9c5f42629dca4d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea83d9c5f42629dca4e" }, "plunkId" : "HaTOfA23JzVZxOrwL6s0", "webPath" : "/task/tree/source", "files" : [ { "filename" : "index.html", "content" : "\n\n \n\n\n\n Животные\n \n Млекопитающие\n \n Коровы \n Ослы \n Собаки \n Тигры \n \n \n Другие\n \n Змеи \n Птицы \n Ящерицы \n \n \n \n \n Рыбы\n \n Аквариумные\n \n\n \n Морские\n \n \n \n \n \n\n\n\n\n\n", "_id" : { "$oid" : "54a04ea83d9c5f42629dca4f" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea93d9c5f42629dca51" }, "plunkId" : "Hkkn4aNVZhiyG2har7ZQ", "webPath" : "/task/set-class-links/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04ea93d9c5f42629dca52" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ea93d9c5f42629dca57" }, "plunkId" : "xxb8WmEGpx8a09nJ1oTA", "webPath" : "/task/benchmark-search-dom/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\t \n \n\n\n\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04ea93d9c5f42629dca58" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04eaa3d9c5f42629dca59" }, "plunkId" : "VKChDdYZ96KWaXqwO4Rj", "webPath" : "/task/benchmark-search-dom/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n\t \n\n\n\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n1
2
3
4
5
6
7
8
9
\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04eaa3d9c5f42629dca5a" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04eaa3d9c5f42629dca5f" }, "plunkId" : "sDXjypEJDXOP1M0uSrGz", "webPath" : "/task/hide-other/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n \n\nТекст
\n\n\n\n\n", "_id" : { "$oid" : "54a04eaa3d9c5f42629dca60" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04eaa3d9c5f42629dca61" }, "plunkId" : "Jndh7Fx3Y2xRfLjkdeqN", "webPath" : "/task/hide-other/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n \n\nТекст
\n\n\n\n\n", "_id" : { "$oid" : "54a04eaa3d9c5f42629dca62" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04eab3d9c5f42629dca66" }, "plunkId" : "MTs9yEKV7F2Hlo6lcoiV", "webPath" : "/task/sliding-menu/solution", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04eab3d9c5f42629dca67" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04eac3d9c5f42629dca68" }, "plunkId" : "nUwPLH2yCC3fPwTaPsjf", "webPath" : "/task/sliding-menu/source", "files" : [ { "filename" : "index.html", "content" : "\n\n\n \n\n\n\n \n \n\nСладости (нажми меня)!\n\n Торт \n Пончик \n Пирожное \n \n\n\n\n\n\n", "_id" : { "$oid" : "54a04eac3d9c5f42629dca69" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04eac3d9c5f42629dca6b" }, "plunkId" : "gybuUBeLAKigka0YM2Sk", "webPath" : "/task/hide-message/solution", "files" : [ { "filename" : "messages.css", "content" : "body {\n\tmargin: 10px auto;\n\twidth: 470px;\n}\nh3 {\n\tmargin: 0;\n\tpadding-bottom: .3em;\n\tpadding-right: 20px;\n\tfont-size: 1.1em;\n}\np {\n\tmargin: 0;\n\tpadding: 0 0 .5em;\n}\n.pane {\n\tbackground: #edf5e1;\n\tpadding: 10px 20px 10px;\n\tborder-top: solid 2px #c4df9b;\n position: relative;\n}\n\n.remove-button {\n\tposition: absolute;\n\ttop: 10px;\n\tright: 10px;\n\tcursor: pointer;\n\tdisplay: block;\n\tbackground: url(delete.gif) no-repeat;\n\twidth: 16px;\n\theight: 16px;\n}\n\n", "_id" : { "$oid" : "54a04eac3d9c5f42629dca6c" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n \n\n\n\n\n\n
\n
Лошадь \n
Домашняя лошадь — животное семейства непарнокопытных, одомашненный и единственный сохранившийся подвид дикой лошади, вымершей в дикой природе, за исключением небольшой популяции лошади Пржевальского.
\n
\n
\n
\n
Осёл \n
Домашний осёл или ишак — одомашненный подвид дикого осла, сыгравший важную историческую роль в развитии хозяйства и культуры человека. Все одомашненные ослы относятся к африканским ослам.
\n
\n
\n
\n
Корова, а также пара слов о диком быке, о волах и о тёлках. \n
Коро́ва — самка домашнего быка, одомашненного подвида дикого быка, парнокопытного жвачного животного семейства полорогих. Самцы вида называются быками, молодняк — телятами, кастрированные самцы — волами. Молодых (до первой стельности) самок называют тёлками.
\n
\n
\n
\n\n\n\n\n\n\n", "_id" : { "$oid" : "54a04eac3d9c5f42629dca6d" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04eac3d9c5f42629dca6e" }, "plunkId" : "pxiMyUkvQDWOW209C7Mo", "webPath" : "/task/hide-message/source", "files" : [ { "filename" : "messages.css", "content" : "body {\n\tmargin: 10px auto;\n\twidth: 470px;\n}\nh3 {\n\tmargin: 0;\n\tpadding-bottom: .3em;\n\tfont-size: 1.1em;\n}\np {\n\tmargin: 0;\n\tpadding: 0 0 .5em;\n}\n.pane {\n\tbackground: #edf5e1;\n\tpadding: 10px 20px 10px;\n\tborder-top: solid 2px #c4df9b;\n}\n", "_id" : { "$oid" : "54a04eac3d9c5f42629dca6f" } }, { "filename" : "index.html", "content" : "\n\n\n \n \n\n\n\n\nКартинка для кнопки удаления: \n\n\n\t
\n
Лошадь \n
Домашняя лошадь — животное семейства непарнокопытных, одомашненный и единственный сохранившийся подвид дикой лошади, вымершей в дикой природе, за исключением небольшой популяции лошади Пржевальского.
\n\t
\n\t
\n
Осёл \n
Домашний осёл или ишак — одомашненный подвид дикого осла, сыгравший важную историческую роль в развитии хозяйства и культуры человека. Все одомашненные ослы относятся к африканским ослам.
\n\t
\n\t
\n
Корова, а также пара слов о диком быке, о волах и о тёлках. \n
Коро́ва — самка домашнего быка, одомашненного подвида дикого быка, парнокопытного жвачного животного семейства полорогих. Самцы вида называются быками, молодняк — телятами, кастрированные самцы — волами. Молодых (до первой стельности) самок называют тёлками.
\n\t
\n
\n\n\n\n", "_id" : { "$oid" : "54a04eac3d9c5f42629dca70" } } ], "description" : "Fork from http://javascript.ru", "__v" : 0 },{ "_id" : { "$oid" : "54a04ead3d9c5f42629dca72" }, "plunkId" : "ZPrRE1wp2qGDvAsrFU4e", "webPath" : "/task/carousel/solution", "files" : [ { "filename" : "style.css", "content" : "body {\n padding: 10px\n}\n\n.carousel {\n position: relative;\n width: 398px;\n padding: 10px 40px;\n border: 1px solid #CCC;\n border-radius: 15px;\n background: #eee;\n}\n.carousel img {\n width: 130px;\n height: 130px;\n display: block; /* если не поставить block, в ряде браузеров будет inline -> лишнее пространтсво вокруг элементов */\n}\n.carousel .arrow {\n position: absolute;\n top: 57px;\n padding: 3px 8px 8px 9px;\n background: #ddd;\n border-radius: 15px;\n font-size: 24px;\n color: #444;\n text-decoration: none;\n}\n\n.carousel .arrow:hover {\n background: #ccc;\n}\n.carousel .left-arrow {\n left: 7px;\n}\n.carousel .right-arrow {\n right: 7px;\n}\n.gallery {\n width: 390px;\n overflow: hidden;\n}\n.gallery ul {\n height: 130px;\n width: 9999px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.gallery ul li {\n\tfloat: left;\n}\n", "_id" : { "$oid" : "54a04ead3d9c5f42629dca73" } }, { "filename" : "index.html", "content" : "\n\n \n \n\n\n\n\n\n\n\n\n