[{"data":1,"prerenderedAt":1972},["ShallowReactive",2],{"$fKAYwBlXpv3U_GkLtxvzfQronktpB-CsUmpw8N3FAYtY":3,"$fMMUdSFktwQFqMVGPrTtt3EC5yheBp7PzwIqznamFcMo":151,"$fc0LoAJgqXDLbKKd2JS_NpM4SuzBK8EycUXINSg09CKU":154,"$fM3ea55k6lKMPOTM84llDB26VSQDVVbxiQuSBFQw9P_c":159,"$f1Prj1xEczHja_-L7FyIGgRHd5_cSWHo7r6AE5aheAik":504,"$fI5fDmvm-5tr9wcH0eHaKZa1j3y_FQIQaHHPqbZxAHJE":726,"mdc-h87u4o-key":746,"mdc--8dlraq-key":758,"mdc--p7pzme-key":772,"mdc--a78thz-key":785,"mdc-3wvoma-key":798,"mdc--pevgja-key":811,"mdc--7fa4tj-key":824,"mdc--vgqhz-key":837,"mdc--9m7tpi-key":850,"mdc-rtk7om-key":863,"mdc-5bm7mr-key":876,"mdc--chrkv4-key":889,"mdc-f3qmju-key":929,"mdc--7sjrzx-key":1108,"mdc--16gkqy-key":1135,"mdc-5kgav8-key":1174,"mdc-bpi1no-key":1205,"mdc--6do01k-key":1239,"mdc-utpqav-key":1247,"mdc--150qfd-key":1264,"mdc-wu0ygk-key":1342,"mdc-28cywv-key":1381,"mdc--nuzoiv-key":1438,"mdc--ukrgb-key":1455,"mdc--1nb3ju-key":1472,"mdc-t4wnnb-key":1526,"mdc-qn14ri-key":1561,"mdc-ueaipx-key":1584,"mdc-g89s8v-key":1601,"mdc--34gldf-key":1898,"mdc--i9xolu-key":1914},{"content":4,"quizQuestionContent":104,"type":141,"pageMeta":142},[5,9,13,16,20,24,28,31,35,38,41,44,48,51,55,58,62,65,68,71,75,78,82,85,88,91,95,98,101],{"id":6,"value":7,"isTypeH1":8},"1905","Способы объявления функций в JavaScript",true,{"id":10,"value":11,"anchor":12,"isTypeH2":8},"4368","Теория: что считается “объявлением”","theory-what-counts-as-declaration",{"id":14,"value":15,"isTypeParagraph":8},"10043","В JavaScript функция создаётся либо как декларация (statement), либо как выражение (expression), которое вычисляется и даёт значение-функцию.  \nДекларация обычно создаёт именованную привязку сразу в области видимости, а выражение создаёт значение, которое затем присваивается переменной или свойству объекта.  \nОтдельно выделяется синтаксис методов в объектах и классах: внешне это похоже на функцию, но в поведении есть отличия (например, методы в краткой записи не предназначены для вызова через `new`).\n",{"id":17,"description":18,"titleAlert":19,"isTypeAlertWarning":8},"694","Объявления функций внутри блоков в нестрогом режиме (`if`, `for`, `{ ... }` без `\"use strict\"`) могут вести себя по-разному в разных окружениях, поэтому такой стиль считается нежелательным.",null,{"id":21,"value":22,"anchor":23,"isTypeH2":8},"4369","Основные способы и различия","main-ways-and-differences",{"id":25,"value":26,"anchor":27,"isTypeH3":8},"4376","Function Declaration: function name() { ... }","function-declaration",{"id":29,"value":30,"isTypeParagraph":8},"10044","Декларация создаёт функцию и имя для неё.  \nКлючевое свойство декларации — поднятие (hoisting): вызов функции допустим до строки, где она записана, если вызов находится в той же области видимости.\n\nПример:\n\n```\ncallBefore();\nfunction callBefore() {\n  console.log(\"вызов возможен до объявления\");\n}\n```",{"id":32,"value":33,"anchor":34,"isTypeH3":8},"4377","Function Expression: const f = function() { ... }","function-expression",{"id":36,"value":37,"isTypeParagraph":8},"10045","Функциональное выражение использует `function` как часть выражения, поэтому такая функция обычно создаётся в момент вычисления выражения (например, при выполнении присваивания).  \nОтличие от декларации: до выполнения присваивания значение переменной ещё не является функцией, поэтому ранний вызов приводит к ошибке.\n\nПример:\n\n```\nconsole.log(typeof notReady); // \"undefined\" (для var) или ReferenceError (для let/const)\nvar notReady = function () {\n  console.log(\"готово\");\n};\nnotReady(); // корректно только после присваивания\n```",{"id":39,"description":40,"titleAlert":19,"isTypeAlertInfo":8},"637","Именованное функциональное выражение удобно для рекурсии, потому что имя видно только внутри тела функции и не добавляется в внешнюю область видимости.",{"id":42,"value":43,"isTypeParagraph":8},"10046","Пример:\n\n```\nconst math = {\n  factorial: function factorial(n) {\n    if (n \u003C= 1) return 1;\n    return n * factorial(n - 1);\n  }\n};\nconsole.log(math.factorial(5));\n```",{"id":45,"value":46,"anchor":47,"isTypeH3":8},"4378","Arrow Function Expression: (...) => ...","arrow-function-expression",{"id":49,"value":50,"isTypeParagraph":8},"10047","Стрелочная функция является выражением и часто применяется для колбэков из-за краткого синтаксиса.  \nУ стрелочной функции нет собственного `this` и `arguments`, поэтому поведение `this` берётся из внешнего окружения, что важно при использовании внутри методов объектов.  \nСтрелочную функцию нельзя вызывать с `new`, и в ней нельзя использовать `yield`, поэтому генераторы через `=>` не объявляются.\n\nПример:\n\n```\nconst sum = (a, b) => a + b;\nconst obj = {\n  value: 10,\n  bad: () => console.log(this.value),\n  good() { console.log(this.value); }\n};\nobj.bad();\nobj.good();\n```",{"id":52,"value":53,"anchor":54,"isTypeH3":8},"4379","Method Definition: методы в объекте и классе","method-definition",{"id":56,"value":57,"isTypeParagraph":8},"10048","Краткая запись метода является специальным синтаксисом для объявления функции как свойства объекта или как метода класса.  \nТакой метод не является конструктором: попытка создать объект через `new` от метода приводит к ошибке типа.  \nВ классе методы обычно находятся в прототипе, поэтому один и тот же код метода разделяется всеми экземплярами.\n\nПример:\n\n```\nconst obj2 = {\n  method() { return 1; }\n};\nclass C {\n  method() { return 2; }\n}\nconsole.log(obj2.method());\nconsole.log(new C().method());\n```",{"id":59,"value":60,"anchor":61,"isTypeH3":8},"4380","Generator Function Declaration: function*","generator-function-declaration",{"id":63,"value":64,"isTypeParagraph":8},"10049","Генераторная декларация `function*` создаёт генератор, который умеет “останавливать” выполнение на `yield` и продолжать позже, сохраняя внутреннее состояние.  \nВызов генератора не выполняет тело сразу, а возвращает итератор; выполнение продвигается вызовами `next()`, которые возвращают объект вида `{ value, done }`.\n\nПример:\n\n```\nfunction* counter(start) {\n  let i = start;\n  while (true) {\n    yield i;\n    i++;\n  }\n}\nconst it = counter(10);\nconsole.log(it.next());\nconsole.log(it.next());\n```",{"id":66,"description":67,"titleAlert":19,"isTypeAlertInfo":8},"638","Конструкция `yield*` применяется для делегирования итерации другому генератору.",{"id":69,"value":70,"isTypeParagraph":8},"10050","Пример:\n\n```\nfunction* genA() {\n  yield 1;\n  yield 2;\n}\nfunction* genB() {\n  yield 0;\n  yield* genA();\n  yield 3;\n}\nconsole.log([...genB()]);\n```",{"id":72,"value":73,"anchor":74,"isTypeH3":8},"4381","Async Function Declaration: async function","async-function-declaration",{"id":76,"value":77,"isTypeParagraph":8},"10051","`async function` создаёт асинхронную функцию, внутри которой разрешён `await`, а вызов возвращает Promise.  \nМежду `async` и `function` не следует размещать перевод строки, иначе в некоторых ситуациях возможна автоматическая вставка точки с запятой и изменение смысла.\n\nПример:\n\n```\nasync function loadValue() {\n  const value = await Promise.resolve(123);\n  return value;\n}\nloadValue().then(console.log);\n```",{"id":79,"value":80,"anchor":81,"isTypeH3":8},"4382","Function constructor: Function(...) / new Function(...)","function-constructor",{"id":83,"value":84,"isTypeParagraph":8},"10052","Конструктор `Function()` создаёт функцию динамически из строк, поэтому код функции формируется во время выполнения программы.  \nТакой способ обычно нежелателен: он усложняет анализ кода, может быть хуже по производительности из‑за разбора строки во время работы и опасен при использовании недоверенных данных.  \nФункции, созданные через `Function`, выполняются в глобальной области видимости, поэтому локальные переменные окружающей функции недоступны (ожидание замыкания является ошибочным).",{"id":86,"description":87,"titleAlert":19,"isTypeAlertWarning":8},"695","Динамическая генерация кода строками (`Function`, `eval`) потенциально опасна при работе с недоверенным вводом, так как может привести к выполнению чужого кода.",{"id":89,"value":90,"isTypeParagraph":8},"10053","Пример:\n\n```\nconst add = new Function(\"a\", \"b\", \"return a + b\");\nconsole.log(add(2, 3));\nfunction outer() {\n  const secret = 42;\n  const f = new Function(\"return typeof secret\");\n  return f();\n}\nconsole.log(outer());\n```",{"id":92,"value":93,"anchor":94,"isTypeH2":8},"4370","Схема и таблица","schema-and-table",{"id":96,"value":97,"isTypeParagraph":8},"10054","Ниже приведена упрощённая схема выбора формы объявления по задаче (чтение сверху вниз).\n\n```\nНужно именованную функцию, доступную до места записи в области видимости?\n-> Function Declaration\n\nНужно передать функцию как значение (колбэк, аргумент, результат)?\n-> Function Expression или Arrow Function\n\nНужно корректное `this` как у метода объекта или класса?\n-> Method Definition (или `function` в свойстве), но обычно не arrow\n\nНужно `yield` и пошаговая генерация значений?\n-> `function*` (generator)\n\nНужно `await` и асинхронность?\n-> `async function`\n\nНужно создать функцию из строки во время выполнения?\n-> Function constructor (с осторожностью)\n```\n\n| Способ | Где встречается в коде | Особенность `this` | `new` (конструктор) | `yield` |\n|---|---|---|---|---|\n| `function name(){}` | декларация | обычное поведение | возможно | нет |\n| `const f = function(){}` | выражение | обычное поведение | возможно | нет |\n| `const f = () => {}` | выражение | лексическое, своего нет | нельзя | нельзя |\n| `obj = { m(){} }`, `class C{ m(){} }` | метод | как у метода | нельзя | только у `*m(){}` |\n| `function* g(){}` | декларация | обычное поведение | возможно | да |\n| `async function f(){}` | декларация | обычное поведение | зависит от вида функции | нет |\n| `new Function(...)` | создание из строки | глобальная область | возможно | нет |",{"id":99,"description":100,"titleAlert":19,"isTypeAlertInfo":8},"639","В современном JavaScript (ES6+) все перечисленные формы встречаются на практике, но чаще всего используются декларации, выражения, стрелочные функции и методы, а `Function(...)` оставляется для редких случаев.",{"id":102,"value":103,"isTypeParagraph":8},"10055","Кратко: К основным способам объявления функций относятся `function` (декларация), `function` как выражение, стрелочная функция `=>`, методы в объектах и классах, генераторы `function*`, асинхронные функции `async function` и динамическое создание через `Function()`, при этом `Function()` следует рассматривать как редкий и потенциально рискованный вариант.",{"id":105,"options":106,"hint":138,"solution":139,"description":140},"1144",[107,111,114,117,120,123,126,129,132,135],{"id":108,"label":109,"isCorrect":110},"4708","`def f() { ... }`",false,{"id":112,"label":113,"isCorrect":8},"4709","`function name(...) { ... }`",{"id":115,"label":116,"isCorrect":8},"4710","`const f = function(...) { ... }`",{"id":118,"label":119,"isCorrect":8},"4711","`const f = (...) => { ... }`",{"id":121,"label":122,"isCorrect":110},"4712","`function => f() { ... }`",{"id":124,"label":125,"isCorrect":8},"4713","`const obj = { method() { ... } } или class C { method() { ... } }`",{"id":127,"label":128,"isCorrect":8},"4714","`function* gen(...) { ... }`",{"id":130,"label":131,"isCorrect":110},"4715","`lambda (x) { return x + 1 }`",{"id":133,"label":134,"isCorrect":8},"4716","`async function name(...) { ... }`",{"id":136,"label":137,"isCorrect":8},"4717","`new Function(arg1, ..., body) или Function(arg1, ..., body)`","Для полного ответа удобно разделять способы на группы: декларации (`function`, `function*`, `async function`), выражения (Function Expression, Arrow Function), методы (сокращённая запись в объекте и классе) и отдельный особый случай (динамическое создание через `Function(...)`).\n","1. `def f() { ... }` — объявление функции через ключевое слово `def`. (неправильный)  \n2. `function name(...) { ... }` — объявление функции (Function Declaration). (**правильный**)  \n3. `const f = function(...) { ... }` — функциональное выражение (Function Expression). (**правильный**)  \n4. `const f = (...) => { ... }` — стрелочная функция (Arrow Function Expression). (**правильный**)  \n5. `function => f() { ... }` — стрелка вместо корректного синтаксиса. (неправильный)\n6. `const obj = { method() { ... } }` или `class C { method() { ... } }` — краткая запись метода (Method Definition). (**правильный**)  \n7. `function* gen(...) { ... }` — генератор (Generator Function Declaration). (**правильный**)  \n8. `lambda (x) { return x + 1 }` — объявление функции через `lambda`. (неправильный)  \n9. `async function name(...) { ... }` — асинхронная функция (Async Function Declaration). (**правильный**)  \n10. `new Function(arg1, ..., body)` или `Function(arg1, ..., body)` — конструктор Function (динамическое создание функции). (**правильный**)  \n\n\n","Какие способы объявления функции есть в JavaScript?","quizQuestion",{"title":140,"description":143,"ogTitle":7,"ogDescription":143,"ogImageUrl":144,"canonical":19,"ogLocale":145,"ogSiteName":146,"ogImageType":147,"ogImageWidth":148,"ogImageHeight":149,"ogType":150,"ogUrl":19},"Разбор для начинающих: declaration, expression, arrow, методы, async, генераторы и Function-конструктор, с примерами и ошибками.","/og-image.png","ru_RU","goodwebjob.ru","image_jpeg","1200","630","article",{"siteName":152,"siteUrl":153},"GOOD WEB JOB!","https://goodwebjob.ru",[155],{"label":156,"slug":157,"to":158},"Подготовка к тех.интервью","technical-interview","/technical-interview/where-to-begin",{"navigationList":160,"navigationSublist":168},[161,164],{"path":158,"isActive":110,"name":162,"icon":163,"isNavbarMobileDisabled":8},"С чего начать?","material-symbols:visibility-outline-rounded",{"path":165,"isActive":8,"name":166,"icon":167,"isNavbarMobileDisabled":110},"/technical-interview/tasks","Сборник задач","material-symbols:task-outline",[169,178,205,217,223,363,387,396,402,465,486,492],{"title":170,"list":171,"isOpened":110},"Bash",[172,175],{"name":173,"path":174,"isActive":110},"Дан фрагмент bash-скрипта: cd ~; mkdir foo... Что в нем происходит?","/technical-interview/tasks/here-is-a-fragment-of-a-bash-script-cd-mkdir-foo-what-is-happening-in-this-script",{"name":176,"path":177,"isActive":110},"Дан фрагмент bash-скрипта: target=$(ps -Af | grep $1 | head -n 1)...","/technical-interview/tasks/here-is-a-fragment-of-a-bash-script-target-ps-af-grep-1-head-n-1",{"title":179,"list":180,"isOpened":110},"CSS",[181,184,187,190,193,196,199,202],{"name":182,"path":183,"isActive":110},"Дан HTML-код. Какой будет цвет у текста «Some dummy text»?","/technical-interview/tasks/the-html-code-is-given-what-will-be-the-color-of-the-some-dummy-text",{"name":185,"path":186,"isActive":110},"Есть шаблон HTML и CSS кода. Какой будет цвет у текста «Таким образом, постоянное»?","/technical-interview/tasks/there-is-a-template-for-html-and-css-code-what-color-will-the-text-thus-constant-have",{"name":188,"path":189,"isActive":110},"Есть шаблон вложенного HTML кода. Какой будет цвет у текста «One more dummy text»?","/technical-interview/tasks/there-is-a-template-for-embedded-html-code-what-will-be-the-color-of-the-one-more-dummy-text",{"name":191,"path":192,"isActive":110},"Есть шаблон вложенного HTML кода. Будет ли display:block у body влиять на span?","/technical-interview/tasks/there-is-a-template-for-embedded-html-code-will-there-be-a-display-does-bodys-block-affect-span",{"name":194,"path":195,"isActive":110},"Есть HTML код. Будет ли font-weight на span влиять?","/technical-interview/tasks/there-is-an-html-code-will-font-weight-affect-span",{"name":197,"path":198,"isActive":110},"Flexbox и Grid, чем отличаются друг от друга?","/technical-interview/tasks/what-are-the-differences-between-flexbox-and-grid",{"name":200,"path":201,"isActive":110},"Заменяют ли Flexbox и Grid друг друга?","/technical-interview/tasks/do-flexbox-and-grid-replace-each-other",{"name":203,"path":204,"isActive":110},"Есть CSS и JS анимация. Какая между ними разница, что быстрее, что более удобно?","/technical-interview/tasks/there-are-css-and-js-animations-what-is-the-difference-between-them-and-which-is-faster-and-more-convenient",{"title":206,"list":207,"isOpened":110},"Git",[208,211,214],{"name":209,"path":210,"isActive":110},"Разрабатывал, взял закоммитил, запушил. Оказалось, что запушил не в ту ветку, точнее, коммит не в ту ветку. Какие действия?","/technical-interview/tasks/developed-it-committed-it-and-launched-it-it-turned-out-that-i-had-pushed-it-to-the-wrong-branch-or-rather-the-commit-was-in-the-wrong-branch-what-actions",{"name":212,"path":213,"isActive":110},"В git есть несколько вариантов слияния веток, какие? Чем отличаются?","/technical-interview/tasks/git-has-several-options-for-merging-branches-which-ones-how-are-they-different",{"name":215,"path":216,"isActive":110},"Какие существуют стратегии ветвления для работы команды? Что это такое?","/technical-interview/tasks/what-are-the-branching-strategies-for-the-team-what-is-it",{"title":218,"list":219,"isOpened":110},"HTML",[220],{"name":221,"path":222,"isActive":110},"Что такое HTML?","/technical-interview/tasks/what-is-html",{"title":224,"list":225,"isOpened":110},"JavaScript",[226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,270,273,276,279,282,285,288,291,294,297,300,303,306,309,312,315,318,321,324,327,330,333,336,339,342,345,348,351,354,357,360],{"name":227,"path":228,"isActive":110},"Какие логические значения в console.log будут получены?","/technical-interview/tasks/prototype-what-logical-values-will-be-received-in-console-log",{"name":230,"path":231,"isActive":110},"Почему опасно писать прямо в прототипы базовых типов?","/technical-interview/tasks/why-is-it-dangerous-to-write-directly-to-the-prototypes-of-basic-types",{"name":233,"path":234,"isActive":110},"Что вернёт следующий код? Object.create(null).hasOwnProperty('toString')","/technical-interview/tasks/what-will-the-following-code-return-object-create-null-has-own-property-to-string",{"name":236,"path":237,"isActive":110},"Какое значение выведет консоль с object.property?","/technical-interview/tasks/what-value-will-the-console-output-with-object-property",{"name":239,"path":240,"isActive":110},"Что выведется в console.log([arr[0](), arr[0]()])?","/technical-interview/tasks/what-will-be-displayed-in-console-log-arr-0-arr-0",{"name":242,"path":243,"isActive":110},"Что выведет console.log в результате выполнения цикла while?","/technical-interview/tasks/what-will-console-log-output-as-a-result-of-executing-the-while-loop",{"name":245,"path":246,"isActive":110},"Есть функция и объект. Напишите все известные вам способы, чтобы вывести в консоли значение x из объекта, используя функцию","/technical-interview/tasks/there-is-a-function-and-an-object-write-all-the-ways-you-know-to-output-the-value-of-x-from-an-object-in-the-console-using-the-function",{"name":248,"path":249,"isActive":110},"Что вернёт метод book.getUpperName()?","/technical-interview/tasks/what-will-the-book-get-upper-name-method-return",{"name":251,"path":252,"isActive":110},"Переменные объявлены следующим образом: a=3; b=«hello»;. Укажите правильное утверждение","/technical-interview/tasks/variables-are-declared-as-follows-specify-the-correct-statement",{"name":254,"path":255,"isActive":110},"Что выведет консоль в случае присвоения свойства массиву по строковому положительному индексу?","/technical-interview/tasks/what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-positive-string-index",{"name":257,"path":258,"isActive":110},"Что выведет консоль в случае присвоения свойства массиву по строковому отрицательному индексу?","/technical-interview/tasks/what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-negative-string-index",{"name":260,"path":261,"isActive":110},"Что выведет консоль в случае удаления элемента массива с помощью оператора delete?","/technical-interview/tasks/what-will-the-console-output-if-an-array-element-is-deleted-using-the-delete-operator",{"name":263,"path":264,"isActive":110},"Что вернёт этот код: typeof (function(){})()","/technical-interview/tasks/what-this-code-will-return-typeof-function",{"name":266,"path":267,"isActive":110},"Что получится в результате передачи объекта как аргумента в функцию и выполнения кода?","/technical-interview/tasks/what-will-happen-when-an-object-is-passed-as-an-argument-to-a-function-and-the-code-is-executed",{"name":140,"path":269,"isActive":110},"/technical-interview/tasks/what-are-the-ways-to-declare-a-function-in-javascript",{"name":271,"path":272,"isActive":110},"Что такое this в JavaScript?","/technical-interview/tasks/what-is-this-in-javascript",{"name":274,"path":275,"isActive":110},"Что такое Event Loop, как работает?","/technical-interview/tasks/what-is-an-event-loop-and-how-does-it-work",{"name":277,"path":278,"isActive":110},"Что будет, если вызвать typeof на необъявленной переменной?","/technical-interview/tasks/what-happens-if-you-call-typeof-on-an-undeclared-variable",{"name":280,"path":281,"isActive":110},"Что показывает оператор typeof в JavaScript?","/technical-interview/tasks/what-does-the-typeof-operator-show-in-javascript",{"name":283,"path":284,"isActive":110},"Какие типы данных существует в JavaScript?","/technical-interview/tasks/what-types-of-data-exist-in-javascript",{"name":286,"path":287,"isActive":110},"Какую структуру использовать для хранения упорядоченного списка строк в JavaScript?","/technical-interview/tasks/what-is-the-best-structure-to-use-for-storing-an-ordered-list-of-strings-in-javascript",{"name":289,"path":290,"isActive":110},"Что вернет typeof для массива?","/technical-interview/tasks/what-will-typeof-return-for-an-array",{"name":292,"path":293,"isActive":110},"Почему оператор typeof, применённый к массиву, возвращает объект?","/technical-interview/tasks/why-does-the-typeof-operator-applied-to-an-array-return-an-object",{"name":295,"path":296,"isActive":110},"Если нужно хранить список уникальных строк, какую структуру данных выбрать?","/technical-interview/tasks/if-you-need-to-store-a-list-of-unique-strings-which-data-structure-should-i-choose",{"name":298,"path":299,"isActive":110},"Что возвращает typeof для new Set в JavaScript?","/technical-interview/tasks/what-does-typeof-return-for-new-set-in-javascript",{"name":301,"path":302,"isActive":110},"Почему в JavaScript два объекта с одинаковым содержимым при сравнении возвращают false?","/technical-interview/tasks/why-do-two-objects-with-the-same-content-return-false-when-compared-in-javascript",{"name":304,"path":305,"isActive":110},"В чем разница между микро- и макро-тасками в JavaScript?","/technical-interview/tasks/what-is-the-difference-between-micro-and-macro-tasks-in-javascript",{"name":307,"path":308,"isActive":110},"arr.push(0) повлияет на массив так же, как если бы мы выполнили...","/technical-interview/tasks/arr-push-0-will-affect-the-array-in-the-same-way-as-if-we-performed",{"name":310,"path":311,"isActive":110},"Вернуть массив от 1 до n, где числа, кратные 3, заменены на 'fizz', кратные 5 - на 'buzz', а кратные и 3, и 5 одновременно - на 'fizzbuzz'","/technical-interview/tasks/returns-an-array-from-1-to-n-replacing-numbers-that-are-multiples-of-3-with-fizz-numbers-that-are-multiples-of-5-with-buzz-and-numbers-that-are-multiples-of-both-3-and-5-with-fizzbuzz",{"name":313,"path":314,"isActive":110},"Дана строка: 'one.two.three.four.five'. Необходимо из строки сделать вложенный объект","/technical-interview/tasks/the-string-one-two-three-four-five-is-given-it-is-necessary-to-make-a-nested-object-out-of-the-string",{"name":316,"path":317,"isActive":110},"Дано дерево (вложенный объект), надо найти сумму всех вершин","/technical-interview/tasks/given-a-tree-nested-object-it-is-necessary-to-find-the-sum-of-all-vertices",{"name":319,"path":320,"isActive":110},"Для каждого вложенного объекта нужно добавить свойство level, которое равняется числу - номер вложенности","/technical-interview/tasks/for-each-nested-object-you-need-to-add-the-level-property-which-is-equal-to-a-number-the-nesting-number",{"name":322,"path":323,"isActive":110},"Для каждой ветви дерева записать номер вложенности данной ветви","/technical-interview/tasks/for-each-branch-of-the-tree-write-down-the-nesting-number-of-this-branch",{"name":325,"path":326,"isActive":110},"Есть массив, в котором лежат объекты с датами, необходимо отсортировать даты по возрастанию","/technical-interview/tasks/there-is-an-array-containing-objects-with-dates-that-need-to-be-sorted-by-date",{"name":328,"path":329,"isActive":110},"Есть слова в массиве, необходимо определить, состоят ли они из одних и тех же букв","/technical-interview/tasks/there-are-words-in-the-array-it-is-necessary-to-determine-whether-they-consist-of-the-same-letters",{"name":331,"path":332,"isActive":110},"Есть строка, состоящая из разных скобок, необходимо проверить, закрыты ли все","/technical-interview/tasks/there-is-a-string-consisting-of-different-brackets-it-is-necessary-to-check-whether-all-are-closed",{"name":334,"path":335,"isActive":110}," Найти в массиве неповторяющиеся числа","/technical-interview/tasks/find-non-repeating-numbers-in-an-array",{"name":337,"path":338,"isActive":110},"Напишите функцию, который сделает из массива объект","/technical-interview/tasks/write-a-function-that-will-make-an-object-out-of-an-array",{"name":340,"path":341,"isActive":110},"Необходимо проверить, являются ли две строки анаграммами друг друга","/technical-interview/tasks/checks-whether-two-strings-are-anagrams-of-each-other",{"name":343,"path":344,"isActive":110},"Нечётные числа должны отсортироваться по возрастанию, а чётные должны остаться на своих местах","/technical-interview/tasks/odd-numbers-should-be-sorted-in-ascending-order-and-even-numbers-should-remain-in-their-original-positions",{"name":346,"path":347,"isActive":110},"Определить, является ли слово палиндромом","/technical-interview/tasks/determines-whether-a-word-is-a-palindrome",{"name":349,"path":350,"isActive":110},"«Расплющивание» массива","/technical-interview/tasks/flattening-the-array",{"name":352,"path":353,"isActive":110},"Реализовать функцию, принимающую аргументы \"*\", \"1\", \"b\", \"1c\" и возвращающую строку \"1*b*1c\"","/technical-interview/tasks/implement-a-function-that-accepts-arguments-1-b-1c-and-the-return-string-1-b-1c",{"name":355,"path":356,"isActive":110},"Сжатие строк","/technical-interview/tasks/string-compression",{"name":358,"path":359,"isActive":110},"Уникализация значений в массиве","/technical-interview/tasks/unifying-values-in-an-array",{"name":361,"path":362,"isActive":110},"Числа от 1 до 100 находятся в массиве, они хаотично перемешанные, но в нём не хватает одного числа из этой последовательности. Необходимо найти его","/technical-interview/tasks/the-numbers-from-1-to-100-are-in-the-array-they-are-randomly-mixed-but-it-lacks-one-number-from-this-sequence-it-is-necessary-to-find-him",{"title":364,"list":365,"isOpened":110},"React",[366,369,372,375,378,381,384],{"name":367,"path":368,"isActive":110},"Для чего нужен React, какие он решает проблемы?","/technical-interview/tasks/what-is-react-used-for-and-what-problems-does-it-solve",{"name":370,"path":371,"isActive":110},"Какой механизм лежит в основе оптимизации обновлений DOM в React?","/technical-interview/tasks/what-is-the-underlying-mechanism-for-optimizing-dom-updates-in-react",{"name":373,"path":374,"isActive":110},"Если убрать в React VDOM/Fiber, и вручную изменять DOM, разве это не оптимально?","/technical-interview/tasks/if-you-remove-the-vdom-fiber-in-react-and-manually-change-the-dom-isn-t-that-optimal",{"name":376,"path":377,"isActive":110},"Есть блок кода. Что в реальном DOM изменится после нажатия на кнопку?","/technical-interview/tasks/there-is-a-block-of-code-what-changes-in-the-real-dom-after-clicking-the-button",{"name":379,"path":380,"isActive":110},"Есть код, в котором список и кнопка. Что в реальном DOM изменится после нажатия на кнопку?","/technical-interview/tasks/there-is-a-code-in-which-there-is-a-list-and-a-button-what-will-change-in-the-real-dom-after-clicking-on-the-button",{"name":382,"path":383,"isActive":110},"Зачем нужен Redux (Mobx/Effector)? Зачем нужен менеджер состояния? Какие проблемы решает?","/technical-interview/tasks/why-do-we-need-redux-mobx-effector-why-do-we-need-a-state-manager-what-problems-does-it-solve",{"name":385,"path":386,"isActive":110},"Что мешает организовать централизованное состояние без менеджера состояния? Если организовать состояние механизмами реакта: контекстом, стейтом, в чем проблема? Что менеджеры состояния привносят?","/technical-interview/tasks/what-prevents-you-from-organizing-a-centralized-state-without-a-state-manager-if-you-organize-the-state-using-react-context-and-state-mechanisms-what-is-the-problem-what-do-state-managers-add",{"title":388,"list":389,"isOpened":110},"Алгоритмы",[390,393],{"name":391,"path":392,"isActive":110},"Что такое алгоритмическая сложность?","/technical-interview/tasks/what-is-algorithmic-complexity",{"name":394,"path":395,"isActive":110},"Какая алгоритмическая сложность у \"быстрой сортировки\"?","/technical-interview/tasks/what-is-the-algorithmic-complexity-of-quick-sort",{"title":397,"list":398,"isOpened":110},"Дебаггинг",[399],{"name":400,"path":401,"isActive":110},"Как диагностировать и исправить нежелательное изменение цвета фона по клику на кнопку, если исходный код сайта запутан и недоступен для прямого чтения?","/technical-interview/tasks/how-can-diagnose-and-fix-unwanted-background-color-changes-when-clicking-on-a-button-if-the-source-code-of-the-site-is-confusing-and-inaccessible-to-direct-reading",{"title":403,"list":404,"isOpened":110},"Компьютерные сети",[405,408,411,414,417,420,423,426,429,432,435,438,441,444,447,450,453,456,459,462],{"name":406,"path":407,"isActive":110},"Как браузер после ввода домена понимает, откуда брать сайт?","/technical-interview/tasks/how-does-the-browser-know-where-to-get-the-website-after-entering-the-domain",{"name":409,"path":410,"isActive":110},"Что такое DNS, как DNS находит нужный IP-адрес?","/technical-interview/tasks/what-is-dns-and-how-does-dns-find-the-correct-ip-address",{"name":412,"path":413,"isActive":110},"Как домен попадает в DNS в таблицу соответствия: домен – ip","/technical-interview/tasks/how-does-a-domain-get-into-the-dns-mapping-table-domain-ip",{"name":415,"path":416,"isActive":110},"Как браузер решает, какое соединение ему открывать, TCP или UDP?","/technical-interview/tasks/how-does-a-browser-decide-whether-to-open-a-tcp-or-udp-connection",{"name":418,"path":419,"isActive":110},"Ключевые отличия TCP и UDP","/technical-interview/tasks/key-differences-between-tcp-and-udp",{"name":421,"path":422,"isActive":110},"\"TCP/IP\" - кем является TCP, а кем IP в данном случае?","/technical-interview/tasks/tcp-ip-who-is-tcp-and-who-is-ip-in-this-case",{"name":424,"path":425,"isActive":110},"Что такое HTTP и из чего состоит?","/technical-interview/tasks/what-is-http-and-what-does-it-consist-of",{"name":427,"path":428,"isActive":110},"Что такое заголовки в HTTP и зачем они нужны?","/technical-interview/tasks/what-are-http-headers-and-why-do-we-need-them",{"name":430,"path":431,"isActive":110},"Что такое параметры в HTTP?","/technical-interview/tasks/what-are-http-parameters",{"name":433,"path":434,"isActive":110},"Где находится HTML-код в структуре HTTP-ответа?","/technical-interview/tasks/where-is-the-html-code-located-in-the-http-response-structure",{"name":436,"path":437,"isActive":110},"Чем отличаются 1.0, 1.1, 2.0, 3.0 версии HTTP?","/technical-interview/tasks/what-are-the-differences-between-http-versions-1-0-1-1-2-0-and-3-0",{"name":439,"path":440,"isActive":110},"Пользователь авторизован на сайте. Как сервер узнает об этом с последующими другими заходами, что «я – авторизованный пользователь»?","/technical-interview/tasks/the-user-is-logged-in-on-the-website-how-does-the-server-know-that-i-am-an-authorized-user-when-the-user-logs-in-again",{"name":442,"path":443,"isActive":110},"Что такое cookie?","/technical-interview/tasks/what-is-a-cookie",{"name":445,"path":446,"isActive":110},"Кто является инициатором записи cookie в браузере?","/technical-interview/tasks/who-initiates-the-cookie-recording-in-the-browser",{"name":448,"path":449,"isActive":110},"Есть ли возможность с клиента (с браузера) управлять cookie?","/technical-interview/tasks/is-it-possible-to-manage-cookies-from-the-client-browser",{"name":451,"path":452,"isActive":110},"Верно ли утверждение, что злоумышленник, контролирующий роутер и прослушивающий трафик, может получить логины и пароли от сайтов, на которые заходит клиент?","/technical-interview/tasks/is-it-true-that-an-attacker-who-controls-a-router-and-listens-to-traffic-can-obtain-logins-and-passwords-from-websites-that-a-client-visits",{"name":454,"path":455,"isActive":110},"Всё, что идет по HTTPS – оно защищено?","/technical-interview/tasks/is-everything-that-goes-through-https-secure",{"name":457,"path":458,"isActive":110},"Все данные зашифрованы, используется https. Хакер взламывает dns и делает подмену одного ip на другой, на фишинговый сайт. В этом случае, злоумышленник может получить данные (логин \\ пароль)?","/technical-interview/tasks/all-data-is-encrypted-https-is-used-let-s-assume-a-hacker-hacks-the-dns-and-makes-a-substitution-of-one-ip-for-another-a-phishing-site",{"name":460,"path":461,"isActive":110},"Есть веб-приложение. Помимо HTTP, какие протоколы того же уровня (Application Layer) можно дополнительно использовать в веб-приложении в браузере?","/technical-interview/tasks/there-is-a-web-application-in-addition-to-http-what-other-protocols-of-the-same-level-application-layer-can-be-used-in-the-web-application-in-browser",{"name":463,"path":464,"isActive":110},"Каким способом может выполняться авторизация пользователя на сайте?","/technical-interview/tasks/how-can-a-user-be-authorized-on-a-website",{"title":466,"list":467,"isOpened":110},"Отрисовка в браузере",[468,471,474,477,480,483],{"name":469,"path":470,"isActive":110},"Что происходит, когда HTTP прислал HTML? Что браузер дальше делает c HTML с учетом того, что она валидная?","/technical-interview/tasks/what-happens-when-http-sends-html-what-does-the-browser-do-with-this-html-given-that-it-is-valid",{"name":472,"path":473,"isActive":110},"Как браузер парсит JavaScript и изображения при рендеринге?","/technical-interview/tasks/how-the-browser-parses-javascript-and-images-when-rendering",{"name":475,"path":476,"isActive":110},"Что в браузере блокирует рендеринг страницы?","/technical-interview/tasks/what-is-blocking-the-page-rendering-in-the-browser",{"name":478,"path":479,"isActive":110},"Что такое DOM в браузере? Что такое CSSOM?","/technical-interview/tasks/what-is-dom-in-a-browser-what-is-cssom",{"name":481,"path":482,"isActive":110},"Что является узлами в DOM?","/technical-interview/tasks/what-are-nodes-in-the-dom",{"name":484,"path":485,"isActive":110},"Из чего состоит CSSOM?","/technical-interview/tasks/what-does-cssom-consist-of",{"title":487,"list":488,"isOpened":110},"Ревью кода",[489],{"name":490,"path":491,"isActive":110},"По каким характеристикам, ревьюер понимает, что данный код - хороший, а этот код - плохой?","/technical-interview/tasks/how-does-a-reviewer-know-which-code-is-good-and-which-code-is-bad",{"title":493,"list":494,"isOpened":110},"Теория вероятности",[495,498,501],{"name":496,"path":497,"isActive":110},"В комнате три человека. Какова вероятность того, что хотя бы двое из них одного пола? То есть два и более.","/technical-interview/tasks/there-are-three-people-in-the-room-what-is-the-probability-that-at-least-two-of-them-are-of-the-same-sex-that-is-two-or-more",{"name":499,"path":500,"isActive":110},"Есть монета. Ее подбрасывают пять раз подряд. Каждый раз записывается, что выпало - орел или решка. Сколько разных последовательностей орлов и решек может при этом получиться?","/technical-interview/tasks/there-is-a-coin-it-is-tossed-five-times-in-a-row-each-time-it-is-recorded-whether-it-lands-on-heads-or-tails-how-many-different-sequences-of-heads-and-tails-can-be-obtained",{"name":502,"path":503,"isActive":110},"Как гарантированно найти лёгкую фальшивую монету среди 8 за минимальное число взвешиваний на чашечных весах?","/technical-interview/tasks/how-can-you-guarantee-to-find-an-easy-fake-coin-among-8-in-the-minimum-number-of-weighings-on-a-balance-scale",{"slugs":505},[506,509,511,513,515,518,521,523,525,527,529,531,534,536,538,540,542,544,546,548,550,552,554,556,558,560,562,564,566,568,570,572,574,576,578,580,582,584,586,588,590,592,594,596,598,600,602,604,606,608,610,612,615,617,619,621,623,625,627,629,631,633,635,637,639,641,643,645,647,649,651,653,655,657,659,661,663,665,667,669,671,673,675,677,679,681,683,685,687,689,691,693,695,697,699,701,703,705,707,709,711,713,715,716,718,720,722,724],{"name":507,"value":508},"Теоретические задания","theoretical-tasks",{"name":263,"value":510},"what-this-code-will-return-typeof-function",{"name":162,"value":512},"where-to-begin",{"name":230,"value":514},"why-is-it-dangerous-to-write-directly-to-the-prototypes-of-basic-types",{"name":516,"value":517},"Backend","backend",{"name":519,"value":520},"Frontend","frontend",{"name":227,"value":522},"prototype-what-logical-values-will-be-received-in-console-log",{"name":343,"value":524},"odd-numbers-should-be-sorted-in-ascending-order-and-even-numbers-should-remain-in-their-original-positions",{"name":334,"value":526},"find-non-repeating-numbers-in-an-array",{"name":307,"value":528},"arr-push-0-will-affect-the-array-in-the-same-way-as-if-we-performed",{"name":313,"value":530},"the-string-one-two-three-four-five-is-given-it-is-necessary-to-make-a-nested-object-out-of-the-string",{"name":532,"value":533},"Реализовать функцию, похоже как в Jquery","implement-a-function-similar-to-jquery",{"name":319,"value":535},"for-each-nested-object-you-need-to-add-the-level-property-which-is-equal-to-a-number-the-nesting-number",{"name":236,"value":537},"what-value-will-the-console-output-with-object-property",{"name":239,"value":539},"what-will-be-displayed-in-console-log-arr-0-arr-0",{"name":310,"value":541},"returns-an-array-from-1-to-n-replacing-numbers-that-are-multiples-of-3-with-fizz-numbers-that-are-multiples-of-5-with-buzz-and-numbers-that-are-multiples-of-both-3-and-5-with-fizzbuzz",{"name":340,"value":543},"checks-whether-two-strings-are-anagrams-of-each-other",{"name":346,"value":545},"determines-whether-a-word-is-a-palindrome",{"name":325,"value":547},"there-is-an-array-containing-objects-with-dates-that-need-to-be-sorted-by-date",{"name":352,"value":549},"implement-a-function-that-accepts-arguments-1-b-1c-and-the-return-string-1-b-1c",{"name":316,"value":551},"given-a-tree-nested-object-it-is-necessary-to-find-the-sum-of-all-vertices",{"name":322,"value":553},"for-each-branch-of-the-tree-write-down-the-nesting-number-of-this-branch",{"name":328,"value":555},"there-are-words-in-the-array-it-is-necessary-to-determine-whether-they-consist-of-the-same-letters",{"name":361,"value":557},"the-numbers-from-1-to-100-are-in-the-array-they-are-randomly-mixed-but-it-lacks-one-number-from-this-sequence-it-is-necessary-to-find-him",{"name":331,"value":559},"there-is-a-string-consisting-of-different-brackets-it-is-necessary-to-check-whether-all-are-closed",{"name":337,"value":561},"write-a-function-that-will-make-an-object-out-of-an-array",{"name":242,"value":563},"what-will-console-log-output-as-a-result-of-executing-the-while-loop",{"name":245,"value":565},"there-is-a-function-and-an-object-write-all-the-ways-you-know-to-output-the-value-of-x-from-an-object-in-the-console-using-the-function",{"name":257,"value":567},"what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-negative-string-index",{"name":260,"value":569},"what-will-the-console-output-if-an-array-element-is-deleted-using-the-delete-operator",{"name":358,"value":571},"unifying-values-in-an-array",{"name":349,"value":573},"flattening-the-array",{"name":248,"value":575},"what-will-the-book-get-upper-name-method-return",{"name":355,"value":577},"string-compression",{"name":254,"value":579},"what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-positive-string-index",{"name":266,"value":581},"what-will-happen-when-an-object-is-passed-as-an-argument-to-a-function-and-the-code-is-executed",{"name":406,"value":583},"how-does-the-browser-know-where-to-get-the-website-after-entering-the-domain",{"name":412,"value":585},"how-does-a-domain-get-into-the-dns-mapping-table-domain-ip",{"name":415,"value":587},"how-does-a-browser-decide-whether-to-open-a-tcp-or-udp-connection",{"name":418,"value":589},"key-differences-between-tcp-and-udp",{"name":421,"value":591},"tcp-ip-who-is-tcp-and-who-is-ip-in-this-case",{"name":424,"value":593},"what-is-http-and-what-does-it-consist-of",{"name":427,"value":595},"what-are-http-headers-and-why-do-we-need-them",{"name":430,"value":597},"what-are-http-parameters",{"name":433,"value":599},"where-is-the-html-code-located-in-the-http-response-structure",{"name":221,"value":601},"what-is-html",{"name":436,"value":603},"what-are-the-differences-between-http-versions-1-0-1-1-2-0-and-3-0",{"name":439,"value":605},"the-user-is-logged-in-on-the-website-how-does-the-server-know-that-i-am-an-authorized-user-when-the-user-logs-in-again",{"name":442,"value":607},"what-is-a-cookie",{"name":445,"value":609},"who-initiates-the-cookie-recording-in-the-browser",{"name":448,"value":611},"is-it-possible-to-manage-cookies-from-the-client-browser",{"name":613,"value":614},"Лайвкодинг","livecoding",{"name":233,"value":616},"what-will-the-following-code-return-object-create-null-has-own-property-to-string",{"name":454,"value":618},"is-everything-that-goes-through-https-secure",{"name":457,"value":620},"all-data-is-encrypted-https-is-used-let-s-assume-a-hacker-hacks-the-dns-and-makes-a-substitution-of-one-ip-for-another-a-phishing-site",{"name":460,"value":622},"there-is-a-web-application-in-addition-to-http-what-other-protocols-of-the-same-level-application-layer-can-be-used-in-the-web-application-in-browser",{"name":472,"value":624},"how-the-browser-parses-javascript-and-images-when-rendering",{"name":469,"value":626},"what-happens-when-http-sends-html-what-does-the-browser-do-with-this-html-given-that-it-is-valid",{"name":475,"value":628},"what-is-blocking-the-page-rendering-in-the-browser",{"name":478,"value":630},"what-is-dom-in-a-browser-what-is-cssom",{"name":481,"value":632},"what-are-nodes-in-the-dom",{"name":484,"value":634},"what-does-cssom-consist-of",{"name":182,"value":636},"the-html-code-is-given-what-will-be-the-color-of-the-some-dummy-text",{"name":185,"value":638},"there-is-a-template-for-html-and-css-code-what-color-will-the-text-thus-constant-have",{"name":188,"value":640},"there-is-a-template-for-embedded-html-code-what-will-be-the-color-of-the-one-more-dummy-text",{"name":191,"value":642},"there-is-a-template-for-embedded-html-code-will-there-be-a-display-does-bodys-block-affect-span",{"name":194,"value":644},"there-is-an-html-code-will-font-weight-affect-span",{"name":197,"value":646},"what-are-the-differences-between-flexbox-and-grid",{"name":200,"value":648},"do-flexbox-and-grid-replace-each-other",{"name":203,"value":650},"there-are-css-and-js-animations-what-is-the-difference-between-them-and-which-is-faster-and-more-convenient",{"name":166,"value":652},"tasks",{"name":140,"value":654},"what-are-the-ways-to-declare-a-function-in-javascript",{"name":271,"value":656},"what-is-this-in-javascript",{"name":274,"value":658},"what-is-an-event-loop-and-how-does-it-work",{"name":277,"value":660},"what-happens-if-you-call-typeof-on-an-undeclared-variable",{"name":280,"value":662},"what-does-the-typeof-operator-show-in-javascript",{"name":283,"value":664},"what-types-of-data-exist-in-javascript",{"name":286,"value":666},"what-is-the-best-structure-to-use-for-storing-an-ordered-list-of-strings-in-javascript",{"name":289,"value":668},"what-will-typeof-return-for-an-array",{"name":292,"value":670},"why-does-the-typeof-operator-applied-to-an-array-return-an-object",{"name":295,"value":672},"if-you-need-to-store-a-list-of-unique-strings-which-data-structure-should-i-choose",{"name":298,"value":674},"what-does-typeof-return-for-new-set-in-javascript",{"name":367,"value":676},"what-is-react-used-for-and-what-problems-does-it-solve",{"name":373,"value":678},"if-you-remove-the-vdom-fiber-in-react-and-manually-change-the-dom-isn-t-that-optimal",{"name":376,"value":680},"there-is-a-block-of-code-what-changes-in-the-real-dom-after-clicking-the-button",{"name":379,"value":682},"there-is-a-code-in-which-there-is-a-list-and-a-button-what-will-change-in-the-real-dom-after-clicking-on-the-button",{"name":382,"value":684},"why-do-we-need-redux-mobx-effector-why-do-we-need-a-state-manager-what-problems-does-it-solve",{"name":400,"value":686},"how-can-diagnose-and-fix-unwanted-background-color-changes-when-clicking-on-a-button-if-the-source-code-of-the-site-is-confusing-and-inaccessible-to-direct-reading",{"name":209,"value":688},"developed-it-committed-it-and-launched-it-it-turned-out-that-i-had-pushed-it-to-the-wrong-branch-or-rather-the-commit-was-in-the-wrong-branch-what-actions",{"name":212,"value":690},"git-has-several-options-for-merging-branches-which-ones-how-are-they-different",{"name":215,"value":692},"what-are-the-branching-strategies-for-the-team-what-is-it",{"name":490,"value":694},"how-does-a-reviewer-know-which-code-is-good-and-which-code-is-bad",{"name":173,"value":696},"here-is-a-fragment-of-a-bash-script-cd-mkdir-foo-what-is-happening-in-this-script",{"name":176,"value":698},"here-is-a-fragment-of-a-bash-script-target-ps-af-grep-1-head-n-1",{"name":391,"value":700},"what-is-algorithmic-complexity",{"name":394,"value":702},"what-is-the-algorithmic-complexity-of-quick-sort",{"name":301,"value":704},"why-do-two-objects-with-the-same-content-return-false-when-compared-in-javascript",{"name":463,"value":706},"how-can-a-user-be-authorized-on-a-website",{"name":304,"value":708},"what-is-the-difference-between-micro-and-macro-tasks-in-javascript",{"name":496,"value":710},"there-are-three-people-in-the-room-what-is-the-probability-that-at-least-two-of-them-are-of-the-same-sex-that-is-two-or-more",{"name":499,"value":712},"there-is-a-coin-it-is-tossed-five-times-in-a-row-each-time-it-is-recorded-whether-it-lands-on-heads-or-tails-how-many-different-sequences-of-heads-and-tails-can-be-obtained",{"name":502,"value":714},"how-can-you-guarantee-to-find-an-easy-fake-coin-among-8-in-the-minimum-number-of-weighings-on-a-balance-scale",{"name":156,"value":157},{"name":451,"value":717},"is-it-true-that-an-attacker-who-controls-a-router-and-listens-to-traffic-can-obtain-logins-and-passwords-from-websites-that-a-client-visits",{"name":409,"value":719},"what-is-dns-and-how-does-dns-find-the-correct-ip-address",{"name":251,"value":721},"variables-are-declared-as-follows-specify-the-correct-statement",{"name":370,"value":723},"what-is-the-underlying-mechanism-for-optimizing-dom-updates-in-react",{"name":385,"value":725},"what-prevents-you-from-organizing-a-centralized-state-without-a-state-manager-if-you-organize-the-state-using-react-context-and-state-mechanisms-what-is-the-problem-what-do-state-managers-add",{"cooperation":727,"copyright":730,"reportError":731,"socialNetwork":733},{"link":728,"title":729},"https://t.me/baurinanton","Сотрудничество","© “GOOD WEB JOB!”",{"label":732,"link":728},"Сообщить об ошибке",{"label":734,"socialNetworkList":735},"Мы в соцсетях:",[736,739,742],{"icon":19,"link":737,"title":738},"https://max.ru/u/f9LHodD0cOKMaukdnnahTeL5pwvjrPfUaZ4S8_1rsNy9I9qsmc9Ar3kP_y8","Max",{"icon":740,"link":728,"title":741},"ic:baseline-telegram","Telegram",{"icon":743,"link":744,"title":745},"ri:vk-fill","https://vk.com/baurinanton","VK",{"data":747,"body":748},{},{"type":749,"children":750},"root",[751],{"type":752,"tag":753,"props":754,"children":755},"element","p",{},[756],{"type":757,"value":140},"text",{"data":759,"body":760},{},{"type":749,"children":761},[762],{"type":752,"tag":753,"props":763,"children":764},{},[765],{"type":752,"tag":766,"props":767,"children":769},"code",{"className":768},[],[770],{"type":757,"value":771},"def f() { ... }",{"data":773,"body":774},{},{"type":749,"children":775},[776],{"type":752,"tag":753,"props":777,"children":778},{},[779],{"type":752,"tag":766,"props":780,"children":782},{"className":781},[],[783],{"type":757,"value":784},"function name(...) { ... }",{"data":786,"body":787},{},{"type":749,"children":788},[789],{"type":752,"tag":753,"props":790,"children":791},{},[792],{"type":752,"tag":766,"props":793,"children":795},{"className":794},[],[796],{"type":757,"value":797},"const f = function(...) { ... }",{"data":799,"body":800},{},{"type":749,"children":801},[802],{"type":752,"tag":753,"props":803,"children":804},{},[805],{"type":752,"tag":766,"props":806,"children":808},{"className":807},[],[809],{"type":757,"value":810},"const f = (...) => { ... }",{"data":812,"body":813},{},{"type":749,"children":814},[815],{"type":752,"tag":753,"props":816,"children":817},{},[818],{"type":752,"tag":766,"props":819,"children":821},{"className":820},[],[822],{"type":757,"value":823},"function => f() { ... }",{"data":825,"body":826},{},{"type":749,"children":827},[828],{"type":752,"tag":753,"props":829,"children":830},{},[831],{"type":752,"tag":766,"props":832,"children":834},{"className":833},[],[835],{"type":757,"value":836},"const obj = { method() { ... } } или class C { method() { ... } }",{"data":838,"body":839},{},{"type":749,"children":840},[841],{"type":752,"tag":753,"props":842,"children":843},{},[844],{"type":752,"tag":766,"props":845,"children":847},{"className":846},[],[848],{"type":757,"value":849},"function* gen(...) { ... }",{"data":851,"body":852},{},{"type":749,"children":853},[854],{"type":752,"tag":753,"props":855,"children":856},{},[857],{"type":752,"tag":766,"props":858,"children":860},{"className":859},[],[861],{"type":757,"value":862},"lambda (x) { return x + 1 }",{"data":864,"body":865},{},{"type":749,"children":866},[867],{"type":752,"tag":753,"props":868,"children":869},{},[870],{"type":752,"tag":766,"props":871,"children":873},{"className":872},[],[874],{"type":757,"value":875},"async function name(...) { ... }",{"data":877,"body":878},{},{"type":749,"children":879},[880],{"type":752,"tag":753,"props":881,"children":882},{},[883],{"type":752,"tag":766,"props":884,"children":886},{"className":885},[],[887],{"type":757,"value":888},"new Function(arg1, ..., body) или Function(arg1, ..., body)",{"data":890,"body":891},{},{"type":749,"children":892},[893],{"type":752,"tag":753,"props":894,"children":895},{},[896,898,904,906,912,913,919,921,927],{"type":757,"value":897},"Для полного ответа удобно разделять способы на группы: декларации (",{"type":752,"tag":766,"props":899,"children":901},{"className":900},[],[902],{"type":757,"value":903},"function",{"type":757,"value":905},", ",{"type":752,"tag":766,"props":907,"children":909},{"className":908},[],[910],{"type":757,"value":911},"function*",{"type":757,"value":905},{"type":752,"tag":766,"props":914,"children":916},{"className":915},[],[917],{"type":757,"value":918},"async function",{"type":757,"value":920},"), выражения (Function Expression, Arrow Function), методы (сокращённая запись в объекте и классе) и отдельный особый случай (динамическое создание через ",{"type":752,"tag":766,"props":922,"children":924},{"className":923},[],[925],{"type":757,"value":926},"Function(...)",{"type":757,"value":928},").",{"data":930,"body":931},{},{"type":749,"children":932},[933],{"type":752,"tag":934,"props":935,"children":936},"ol",{},[937,956,974,989,1004,1014,1038,1053,1070,1085],{"type":752,"tag":938,"props":939,"children":940},"li",{},[941,946,948,954],{"type":752,"tag":766,"props":942,"children":944},{"className":943},[],[945],{"type":757,"value":771},{"type":757,"value":947}," — объявление функции через ключевое слово ",{"type":752,"tag":766,"props":949,"children":951},{"className":950},[],[952],{"type":757,"value":953},"def",{"type":757,"value":955},". (неправильный)",{"type":752,"tag":938,"props":957,"children":958},{},[959,964,966,972],{"type":752,"tag":766,"props":960,"children":962},{"className":961},[],[963],{"type":757,"value":784},{"type":757,"value":965}," — объявление функции (Function Declaration). (",{"type":752,"tag":967,"props":968,"children":969},"strong",{},[970],{"type":757,"value":971},"правильный",{"type":757,"value":973},")",{"type":752,"tag":938,"props":975,"children":976},{},[977,982,984,988],{"type":752,"tag":766,"props":978,"children":980},{"className":979},[],[981],{"type":757,"value":797},{"type":757,"value":983}," — функциональное выражение (Function Expression). (",{"type":752,"tag":967,"props":985,"children":986},{},[987],{"type":757,"value":971},{"type":757,"value":973},{"type":752,"tag":938,"props":990,"children":991},{},[992,997,999,1003],{"type":752,"tag":766,"props":993,"children":995},{"className":994},[],[996],{"type":757,"value":810},{"type":757,"value":998}," — стрелочная функция (Arrow Function Expression). (",{"type":752,"tag":967,"props":1000,"children":1001},{},[1002],{"type":757,"value":971},{"type":757,"value":973},{"type":752,"tag":938,"props":1005,"children":1006},{},[1007,1012],{"type":752,"tag":766,"props":1008,"children":1010},{"className":1009},[],[1011],{"type":757,"value":823},{"type":757,"value":1013}," — стрелка вместо корректного синтаксиса. (неправильный)",{"type":752,"tag":938,"props":1015,"children":1016},{},[1017,1023,1025,1031,1033,1037],{"type":752,"tag":766,"props":1018,"children":1020},{"className":1019},[],[1021],{"type":757,"value":1022},"const obj = { method() { ... } }",{"type":757,"value":1024}," или ",{"type":752,"tag":766,"props":1026,"children":1028},{"className":1027},[],[1029],{"type":757,"value":1030},"class C { method() { ... } }",{"type":757,"value":1032}," — краткая запись метода (Method Definition). (",{"type":752,"tag":967,"props":1034,"children":1035},{},[1036],{"type":757,"value":971},{"type":757,"value":973},{"type":752,"tag":938,"props":1039,"children":1040},{},[1041,1046,1048,1052],{"type":752,"tag":766,"props":1042,"children":1044},{"className":1043},[],[1045],{"type":757,"value":849},{"type":757,"value":1047}," — генератор (Generator Function Declaration). (",{"type":752,"tag":967,"props":1049,"children":1050},{},[1051],{"type":757,"value":971},{"type":757,"value":973},{"type":752,"tag":938,"props":1054,"children":1055},{},[1056,1061,1063,1069],{"type":752,"tag":766,"props":1057,"children":1059},{"className":1058},[],[1060],{"type":757,"value":862},{"type":757,"value":1062}," — объявление функции через ",{"type":752,"tag":766,"props":1064,"children":1066},{"className":1065},[],[1067],{"type":757,"value":1068},"lambda",{"type":757,"value":955},{"type":752,"tag":938,"props":1071,"children":1072},{},[1073,1078,1080,1084],{"type":752,"tag":766,"props":1074,"children":1076},{"className":1075},[],[1077],{"type":757,"value":875},{"type":757,"value":1079}," — асинхронная функция (Async Function Declaration). (",{"type":752,"tag":967,"props":1081,"children":1082},{},[1083],{"type":757,"value":971},{"type":757,"value":973},{"type":752,"tag":938,"props":1086,"children":1087},{},[1088,1094,1095,1101,1103,1107],{"type":752,"tag":766,"props":1089,"children":1091},{"className":1090},[],[1092],{"type":757,"value":1093},"new Function(arg1, ..., body)",{"type":757,"value":1024},{"type":752,"tag":766,"props":1096,"children":1098},{"className":1097},[],[1099],{"type":757,"value":1100},"Function(arg1, ..., body)",{"type":757,"value":1102}," — конструктор Function (динамическое создание функции). (",{"type":752,"tag":967,"props":1104,"children":1105},{},[1106],{"type":757,"value":971},{"type":757,"value":973},{"data":1109,"body":1110},{},{"type":749,"children":1111},[1112],{"type":752,"tag":753,"props":1113,"children":1114},{},[1115,1117,1121,1123,1126,1128,1134],{"type":757,"value":1116},"В JavaScript функция создаётся либо как декларация (statement), либо как выражение (expression), которое вычисляется и даёт значение-функцию.",{"type":752,"tag":1118,"props":1119,"children":1120},"br",{},[],{"type":757,"value":1122},"\nДекларация обычно создаёт именованную привязку сразу в области видимости, а выражение создаёт значение, которое затем присваивается переменной или свойству объекта.",{"type":752,"tag":1118,"props":1124,"children":1125},{},[],{"type":757,"value":1127},"\nОтдельно выделяется синтаксис методов в объектах и классах: внешне это похоже на функцию, но в поведении есть отличия (например, методы в краткой записи не предназначены для вызова через ",{"type":752,"tag":766,"props":1129,"children":1131},{"className":1130},[],[1132],{"type":757,"value":1133},"new",{"type":757,"value":928},{"data":1136,"body":1137},{},{"type":749,"children":1138},[1139],{"type":752,"tag":753,"props":1140,"children":1141},{},[1142,1144,1150,1151,1157,1158,1164,1166,1172],{"type":757,"value":1143},"Объявления функций внутри блоков в нестрогом режиме (",{"type":752,"tag":766,"props":1145,"children":1147},{"className":1146},[],[1148],{"type":757,"value":1149},"if",{"type":757,"value":905},{"type":752,"tag":766,"props":1152,"children":1154},{"className":1153},[],[1155],{"type":757,"value":1156},"for",{"type":757,"value":905},{"type":752,"tag":766,"props":1159,"children":1161},{"className":1160},[],[1162],{"type":757,"value":1163},"{ ... }",{"type":757,"value":1165}," без ",{"type":752,"tag":766,"props":1167,"children":1169},{"className":1168},[],[1170],{"type":757,"value":1171},"\"use strict\"",{"type":757,"value":1173},") могут вести себя по-разному в разных окружениях, поэтому такой стиль считается нежелательным.",{"data":1175,"body":1176},{},{"type":749,"children":1177},[1178,1188,1193],{"type":752,"tag":753,"props":1179,"children":1180},{},[1181,1183,1186],{"type":757,"value":1182},"Декларация создаёт функцию и имя для неё.",{"type":752,"tag":1118,"props":1184,"children":1185},{},[],{"type":757,"value":1187},"\nКлючевое свойство декларации — поднятие (hoisting): вызов функции допустим до строки, где она записана, если вызов находится в той же области видимости.",{"type":752,"tag":753,"props":1189,"children":1190},{},[1191],{"type":757,"value":1192},"Пример:",{"type":752,"tag":1194,"props":1195,"children":1199},"pre",{"className":1196,"code":1198,"language":757},[1197],"language-text","callBefore();\nfunction callBefore() {\n  console.log(\"вызов возможен до объявления\");\n}\n",[1200],{"type":752,"tag":766,"props":1201,"children":1203},{"__ignoreMap":1202},"",[1204],{"type":757,"value":1198},{"data":1206,"body":1207},{},{"type":749,"children":1208},[1209,1226,1230],{"type":752,"tag":753,"props":1210,"children":1211},{},[1212,1214,1219,1221,1224],{"type":757,"value":1213},"Функциональное выражение использует ",{"type":752,"tag":766,"props":1215,"children":1217},{"className":1216},[],[1218],{"type":757,"value":903},{"type":757,"value":1220}," как часть выражения, поэтому такая функция обычно создаётся в момент вычисления выражения (например, при выполнении присваивания).",{"type":752,"tag":1118,"props":1222,"children":1223},{},[],{"type":757,"value":1225},"\nОтличие от декларации: до выполнения присваивания значение переменной ещё не является функцией, поэтому ранний вызов приводит к ошибке.",{"type":752,"tag":753,"props":1227,"children":1228},{},[1229],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1231,"children":1234},{"className":1232,"code":1233,"language":757},[1197],"console.log(typeof notReady); // \"undefined\" (для var) или ReferenceError (для let/const)\nvar notReady = function () {\n  console.log(\"готово\");\n};\nnotReady(); // корректно только после присваивания\n",[1235],{"type":752,"tag":766,"props":1236,"children":1237},{"__ignoreMap":1202},[1238],{"type":757,"value":1233},{"data":1240,"body":1241},{},{"type":749,"children":1242},[1243],{"type":752,"tag":753,"props":1244,"children":1245},{},[1246],{"type":757,"value":40},{"data":1248,"body":1249},{},{"type":749,"children":1250},[1251,1255],{"type":752,"tag":753,"props":1252,"children":1253},{},[1254],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1256,"children":1259},{"className":1257,"code":1258,"language":757},[1197],"const math = {\n  factorial: function factorial(n) {\n    if (n \u003C= 1) return 1;\n    return n * factorial(n - 1);\n  }\n};\nconsole.log(math.factorial(5));\n",[1260],{"type":752,"tag":766,"props":1261,"children":1262},{"__ignoreMap":1202},[1263],{"type":757,"value":1258},{"data":1265,"body":1266},{},{"type":749,"children":1267},[1268,1329,1333],{"type":752,"tag":753,"props":1269,"children":1270},{},[1271,1273,1276,1278,1284,1286,1292,1294,1299,1301,1304,1306,1311,1313,1319,1321,1327],{"type":757,"value":1272},"Стрелочная функция является выражением и часто применяется для колбэков из-за краткого синтаксиса.",{"type":752,"tag":1118,"props":1274,"children":1275},{},[],{"type":757,"value":1277},"\nУ стрелочной функции нет собственного ",{"type":752,"tag":766,"props":1279,"children":1281},{"className":1280},[],[1282],{"type":757,"value":1283},"this",{"type":757,"value":1285}," и ",{"type":752,"tag":766,"props":1287,"children":1289},{"className":1288},[],[1290],{"type":757,"value":1291},"arguments",{"type":757,"value":1293},", поэтому поведение ",{"type":752,"tag":766,"props":1295,"children":1297},{"className":1296},[],[1298],{"type":757,"value":1283},{"type":757,"value":1300}," берётся из внешнего окружения, что важно при использовании внутри методов объектов.",{"type":752,"tag":1118,"props":1302,"children":1303},{},[],{"type":757,"value":1305},"\nСтрелочную функцию нельзя вызывать с ",{"type":752,"tag":766,"props":1307,"children":1309},{"className":1308},[],[1310],{"type":757,"value":1133},{"type":757,"value":1312},", и в ней нельзя использовать ",{"type":752,"tag":766,"props":1314,"children":1316},{"className":1315},[],[1317],{"type":757,"value":1318},"yield",{"type":757,"value":1320},", поэтому генераторы через ",{"type":752,"tag":766,"props":1322,"children":1324},{"className":1323},[],[1325],{"type":757,"value":1326},"=>",{"type":757,"value":1328}," не объявляются.",{"type":752,"tag":753,"props":1330,"children":1331},{},[1332],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1334,"children":1337},{"className":1335,"code":1336,"language":757},[1197],"const sum = (a, b) => a + b;\nconst obj = {\n  value: 10,\n  bad: () => console.log(this.value),\n  good() { console.log(this.value); }\n};\nobj.bad();\nobj.good();\n",[1338],{"type":752,"tag":766,"props":1339,"children":1340},{"__ignoreMap":1202},[1341],{"type":757,"value":1336},{"data":1343,"body":1344},{},{"type":749,"children":1345},[1346,1368,1372],{"type":752,"tag":753,"props":1347,"children":1348},{},[1349,1351,1354,1356,1361,1363,1366],{"type":757,"value":1350},"Краткая запись метода является специальным синтаксисом для объявления функции как свойства объекта или как метода класса.",{"type":752,"tag":1118,"props":1352,"children":1353},{},[],{"type":757,"value":1355},"\nТакой метод не является конструктором: попытка создать объект через ",{"type":752,"tag":766,"props":1357,"children":1359},{"className":1358},[],[1360],{"type":757,"value":1133},{"type":757,"value":1362}," от метода приводит к ошибке типа.",{"type":752,"tag":1118,"props":1364,"children":1365},{},[],{"type":757,"value":1367},"\nВ классе методы обычно находятся в прототипе, поэтому один и тот же код метода разделяется всеми экземплярами.",{"type":752,"tag":753,"props":1369,"children":1370},{},[1371],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1373,"children":1376},{"className":1374,"code":1375,"language":757},[1197],"const obj2 = {\n  method() { return 1; }\n};\nclass C {\n  method() { return 2; }\n}\nconsole.log(obj2.method());\nconsole.log(new C().method());\n",[1377],{"type":752,"tag":766,"props":1378,"children":1379},{"__ignoreMap":1202},[1380],{"type":757,"value":1375},{"data":1382,"body":1383},{},{"type":749,"children":1384},[1385,1425,1429],{"type":752,"tag":753,"props":1386,"children":1387},{},[1388,1390,1395,1397,1402,1404,1407,1409,1415,1417,1423],{"type":757,"value":1389},"Генераторная декларация ",{"type":752,"tag":766,"props":1391,"children":1393},{"className":1392},[],[1394],{"type":757,"value":911},{"type":757,"value":1396}," создаёт генератор, который умеет “останавливать” выполнение на ",{"type":752,"tag":766,"props":1398,"children":1400},{"className":1399},[],[1401],{"type":757,"value":1318},{"type":757,"value":1403}," и продолжать позже, сохраняя внутреннее состояние.",{"type":752,"tag":1118,"props":1405,"children":1406},{},[],{"type":757,"value":1408},"\nВызов генератора не выполняет тело сразу, а возвращает итератор; выполнение продвигается вызовами ",{"type":752,"tag":766,"props":1410,"children":1412},{"className":1411},[],[1413],{"type":757,"value":1414},"next()",{"type":757,"value":1416},", которые возвращают объект вида ",{"type":752,"tag":766,"props":1418,"children":1420},{"className":1419},[],[1421],{"type":757,"value":1422},"{ value, done }",{"type":757,"value":1424},".",{"type":752,"tag":753,"props":1426,"children":1427},{},[1428],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1430,"children":1433},{"className":1431,"code":1432,"language":757},[1197],"function* counter(start) {\n  let i = start;\n  while (true) {\n    yield i;\n    i++;\n  }\n}\nconst it = counter(10);\nconsole.log(it.next());\nconsole.log(it.next());\n",[1434],{"type":752,"tag":766,"props":1435,"children":1436},{"__ignoreMap":1202},[1437],{"type":757,"value":1432},{"data":1439,"body":1440},{},{"type":749,"children":1441},[1442],{"type":752,"tag":753,"props":1443,"children":1444},{},[1445,1447,1453],{"type":757,"value":1446},"Конструкция ",{"type":752,"tag":766,"props":1448,"children":1450},{"className":1449},[],[1451],{"type":757,"value":1452},"yield*",{"type":757,"value":1454}," применяется для делегирования итерации другому генератору.",{"data":1456,"body":1457},{},{"type":749,"children":1458},[1459,1463],{"type":752,"tag":753,"props":1460,"children":1461},{},[1462],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1464,"children":1467},{"className":1465,"code":1466,"language":757},[1197],"function* genA() {\n  yield 1;\n  yield 2;\n}\nfunction* genB() {\n  yield 0;\n  yield* genA();\n  yield 3;\n}\nconsole.log([...genB()]);\n",[1468],{"type":752,"tag":766,"props":1469,"children":1470},{"__ignoreMap":1202},[1471],{"type":757,"value":1466},{"data":1473,"body":1474},{},{"type":749,"children":1475},[1476,1513,1517],{"type":752,"tag":753,"props":1477,"children":1478},{},[1479,1484,1486,1492,1494,1497,1499,1505,1506,1511],{"type":752,"tag":766,"props":1480,"children":1482},{"className":1481},[],[1483],{"type":757,"value":918},{"type":757,"value":1485}," создаёт асинхронную функцию, внутри которой разрешён ",{"type":752,"tag":766,"props":1487,"children":1489},{"className":1488},[],[1490],{"type":757,"value":1491},"await",{"type":757,"value":1493},", а вызов возвращает Promise.",{"type":752,"tag":1118,"props":1495,"children":1496},{},[],{"type":757,"value":1498},"\nМежду ",{"type":752,"tag":766,"props":1500,"children":1502},{"className":1501},[],[1503],{"type":757,"value":1504},"async",{"type":757,"value":1285},{"type":752,"tag":766,"props":1507,"children":1509},{"className":1508},[],[1510],{"type":757,"value":903},{"type":757,"value":1512}," не следует размещать перевод строки, иначе в некоторых ситуациях возможна автоматическая вставка точки с запятой и изменение смысла.",{"type":752,"tag":753,"props":1514,"children":1515},{},[1516],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1518,"children":1521},{"className":1519,"code":1520,"language":757},[1197],"async function loadValue() {\n  const value = await Promise.resolve(123);\n  return value;\n}\nloadValue().then(console.log);\n",[1522],{"type":752,"tag":766,"props":1523,"children":1524},{"__ignoreMap":1202},[1525],{"type":757,"value":1520},{"data":1527,"body":1528},{},{"type":749,"children":1529},[1530],{"type":752,"tag":753,"props":1531,"children":1532},{},[1533,1535,1541,1543,1546,1548,1551,1553,1559],{"type":757,"value":1534},"Конструктор ",{"type":752,"tag":766,"props":1536,"children":1538},{"className":1537},[],[1539],{"type":757,"value":1540},"Function()",{"type":757,"value":1542}," создаёт функцию динамически из строк, поэтому код функции формируется во время выполнения программы.",{"type":752,"tag":1118,"props":1544,"children":1545},{},[],{"type":757,"value":1547},"\nТакой способ обычно нежелателен: он усложняет анализ кода, может быть хуже по производительности из‑за разбора строки во время работы и опасен при использовании недоверенных данных.",{"type":752,"tag":1118,"props":1549,"children":1550},{},[],{"type":757,"value":1552},"\nФункции, созданные через ",{"type":752,"tag":766,"props":1554,"children":1556},{"className":1555},[],[1557],{"type":757,"value":1558},"Function",{"type":757,"value":1560},", выполняются в глобальной области видимости, поэтому локальные переменные окружающей функции недоступны (ожидание замыкания является ошибочным).",{"data":1562,"body":1563},{},{"type":749,"children":1564},[1565],{"type":752,"tag":753,"props":1566,"children":1567},{},[1568,1570,1575,1576,1582],{"type":757,"value":1569},"Динамическая генерация кода строками (",{"type":752,"tag":766,"props":1571,"children":1573},{"className":1572},[],[1574],{"type":757,"value":1558},{"type":757,"value":905},{"type":752,"tag":766,"props":1577,"children":1579},{"className":1578},[],[1580],{"type":757,"value":1581},"eval",{"type":757,"value":1583},") потенциально опасна при работе с недоверенным вводом, так как может привести к выполнению чужого кода.",{"data":1585,"body":1586},{},{"type":749,"children":1587},[1588,1592],{"type":752,"tag":753,"props":1589,"children":1590},{},[1591],{"type":757,"value":1192},{"type":752,"tag":1194,"props":1593,"children":1596},{"className":1594,"code":1595,"language":757},[1197],"const add = new Function(\"a\", \"b\", \"return a + b\");\nconsole.log(add(2, 3));\nfunction outer() {\n  const secret = 42;\n  const f = new Function(\"return typeof secret\");\n  return f();\n}\nconsole.log(outer());\n",[1597],{"type":752,"tag":766,"props":1598,"children":1599},{"__ignoreMap":1202},[1600],{"type":757,"value":1595},{"data":1602,"body":1603},{},{"type":749,"children":1604},[1605,1610,1619],{"type":752,"tag":753,"props":1606,"children":1607},{},[1608],{"type":757,"value":1609},"Ниже приведена упрощённая схема выбора формы объявления по задаче (чтение сверху вниз).",{"type":752,"tag":1194,"props":1611,"children":1614},{"className":1612,"code":1613,"language":757},[1197],"Нужно именованную функцию, доступную до места записи в области видимости?\n-> Function Declaration\n\nНужно передать функцию как значение (колбэк, аргумент, результат)?\n-> Function Expression или Arrow Function\n\nНужно корректное `this` как у метода объекта или класса?\n-> Method Definition (или `function` в свойстве), но обычно не arrow\n\nНужно `yield` и пошаговая генерация значений?\n-> `function*` (generator)\n\nНужно `await` и асинхронность?\n-> `async function`\n\nНужно создать функцию из строки во время выполнения?\n-> Function constructor (с осторожностью)\n",[1615],{"type":752,"tag":766,"props":1616,"children":1617},{"__ignoreMap":1202},[1618],{"type":757,"value":1613},{"type":752,"tag":1620,"props":1621,"children":1622},"table",{},[1623,1670],{"type":752,"tag":1624,"props":1625,"children":1626},"thead",{},[1627],{"type":752,"tag":1628,"props":1629,"children":1630},"tr",{},[1631,1637,1642,1652,1662],{"type":752,"tag":1632,"props":1633,"children":1634},"th",{},[1635],{"type":757,"value":1636},"Способ",{"type":752,"tag":1632,"props":1638,"children":1639},{},[1640],{"type":757,"value":1641},"Где встречается в коде",{"type":752,"tag":1632,"props":1643,"children":1644},{},[1645,1647],{"type":757,"value":1646},"Особенность ",{"type":752,"tag":766,"props":1648,"children":1650},{"className":1649},[],[1651],{"type":757,"value":1283},{"type":752,"tag":1632,"props":1653,"children":1654},{},[1655,1660],{"type":752,"tag":766,"props":1656,"children":1658},{"className":1657},[],[1659],{"type":757,"value":1133},{"type":757,"value":1661}," (конструктор)",{"type":752,"tag":1632,"props":1663,"children":1664},{},[1665],{"type":752,"tag":766,"props":1666,"children":1668},{"className":1667},[],[1669],{"type":757,"value":1318},{"type":752,"tag":1671,"props":1672,"children":1673},"tbody",{},[1674,1707,1736,1766,1810,1839,1868],{"type":752,"tag":1628,"props":1675,"children":1676},{},[1677,1687,1692,1697,1702],{"type":752,"tag":1678,"props":1679,"children":1680},"td",{},[1681],{"type":752,"tag":766,"props":1682,"children":1684},{"className":1683},[],[1685],{"type":757,"value":1686},"function name(){}",{"type":752,"tag":1678,"props":1688,"children":1689},{},[1690],{"type":757,"value":1691},"декларация",{"type":752,"tag":1678,"props":1693,"children":1694},{},[1695],{"type":757,"value":1696},"обычное поведение",{"type":752,"tag":1678,"props":1698,"children":1699},{},[1700],{"type":757,"value":1701},"возможно",{"type":752,"tag":1678,"props":1703,"children":1704},{},[1705],{"type":757,"value":1706},"нет",{"type":752,"tag":1628,"props":1708,"children":1709},{},[1710,1719,1724,1728,1732],{"type":752,"tag":1678,"props":1711,"children":1712},{},[1713],{"type":752,"tag":766,"props":1714,"children":1716},{"className":1715},[],[1717],{"type":757,"value":1718},"const f = function(){}",{"type":752,"tag":1678,"props":1720,"children":1721},{},[1722],{"type":757,"value":1723},"выражение",{"type":752,"tag":1678,"props":1725,"children":1726},{},[1727],{"type":757,"value":1696},{"type":752,"tag":1678,"props":1729,"children":1730},{},[1731],{"type":757,"value":1701},{"type":752,"tag":1678,"props":1733,"children":1734},{},[1735],{"type":757,"value":1706},{"type":752,"tag":1628,"props":1737,"children":1738},{},[1739,1748,1752,1757,1762],{"type":752,"tag":1678,"props":1740,"children":1741},{},[1742],{"type":752,"tag":766,"props":1743,"children":1745},{"className":1744},[],[1746],{"type":757,"value":1747},"const f = () => {}",{"type":752,"tag":1678,"props":1749,"children":1750},{},[1751],{"type":757,"value":1723},{"type":752,"tag":1678,"props":1753,"children":1754},{},[1755],{"type":757,"value":1756},"лексическое, своего нет",{"type":752,"tag":1678,"props":1758,"children":1759},{},[1760],{"type":757,"value":1761},"нельзя",{"type":752,"tag":1678,"props":1763,"children":1764},{},[1765],{"type":757,"value":1761},{"type":752,"tag":1628,"props":1767,"children":1768},{},[1769,1785,1790,1795,1799],{"type":752,"tag":1678,"props":1770,"children":1771},{},[1772,1778,1779],{"type":752,"tag":766,"props":1773,"children":1775},{"className":1774},[],[1776],{"type":757,"value":1777},"obj = { m(){} }",{"type":757,"value":905},{"type":752,"tag":766,"props":1780,"children":1782},{"className":1781},[],[1783],{"type":757,"value":1784},"class C{ m(){} }",{"type":752,"tag":1678,"props":1786,"children":1787},{},[1788],{"type":757,"value":1789},"метод",{"type":752,"tag":1678,"props":1791,"children":1792},{},[1793],{"type":757,"value":1794},"как у метода",{"type":752,"tag":1678,"props":1796,"children":1797},{},[1798],{"type":757,"value":1761},{"type":752,"tag":1678,"props":1800,"children":1801},{},[1802,1804],{"type":757,"value":1803},"только у ",{"type":752,"tag":766,"props":1805,"children":1807},{"className":1806},[],[1808],{"type":757,"value":1809},"*m(){}",{"type":752,"tag":1628,"props":1811,"children":1812},{},[1813,1822,1826,1830,1834],{"type":752,"tag":1678,"props":1814,"children":1815},{},[1816],{"type":752,"tag":766,"props":1817,"children":1819},{"className":1818},[],[1820],{"type":757,"value":1821},"function* g(){}",{"type":752,"tag":1678,"props":1823,"children":1824},{},[1825],{"type":757,"value":1691},{"type":752,"tag":1678,"props":1827,"children":1828},{},[1829],{"type":757,"value":1696},{"type":752,"tag":1678,"props":1831,"children":1832},{},[1833],{"type":757,"value":1701},{"type":752,"tag":1678,"props":1835,"children":1836},{},[1837],{"type":757,"value":1838},"да",{"type":752,"tag":1628,"props":1840,"children":1841},{},[1842,1851,1855,1859,1864],{"type":752,"tag":1678,"props":1843,"children":1844},{},[1845],{"type":752,"tag":766,"props":1846,"children":1848},{"className":1847},[],[1849],{"type":757,"value":1850},"async function f(){}",{"type":752,"tag":1678,"props":1852,"children":1853},{},[1854],{"type":757,"value":1691},{"type":752,"tag":1678,"props":1856,"children":1857},{},[1858],{"type":757,"value":1696},{"type":752,"tag":1678,"props":1860,"children":1861},{},[1862],{"type":757,"value":1863},"зависит от вида функции",{"type":752,"tag":1678,"props":1865,"children":1866},{},[1867],{"type":757,"value":1706},{"type":752,"tag":1628,"props":1869,"children":1870},{},[1871,1880,1885,1890,1894],{"type":752,"tag":1678,"props":1872,"children":1873},{},[1874],{"type":752,"tag":766,"props":1875,"children":1877},{"className":1876},[],[1878],{"type":757,"value":1879},"new Function(...)",{"type":752,"tag":1678,"props":1881,"children":1882},{},[1883],{"type":757,"value":1884},"создание из строки",{"type":752,"tag":1678,"props":1886,"children":1887},{},[1888],{"type":757,"value":1889},"глобальная область",{"type":752,"tag":1678,"props":1891,"children":1892},{},[1893],{"type":757,"value":1701},{"type":752,"tag":1678,"props":1895,"children":1896},{},[1897],{"type":757,"value":1706},{"data":1899,"body":1900},{},{"type":749,"children":1901},[1902],{"type":752,"tag":753,"props":1903,"children":1904},{},[1905,1907,1912],{"type":757,"value":1906},"В современном JavaScript (ES6+) все перечисленные формы встречаются на практике, но чаще всего используются декларации, выражения, стрелочные функции и методы, а ",{"type":752,"tag":766,"props":1908,"children":1910},{"className":1909},[],[1911],{"type":757,"value":926},{"type":757,"value":1913}," оставляется для редких случаев.",{"data":1915,"body":1916},{},{"type":749,"children":1917},[1918],{"type":752,"tag":753,"props":1919,"children":1920},{},[1921,1923,1928,1930,1935,1937,1942,1944,1949,1951,1956,1958,1963,1965,1970],{"type":757,"value":1922},"Кратко: К основным способам объявления функций относятся ",{"type":752,"tag":766,"props":1924,"children":1926},{"className":1925},[],[1927],{"type":757,"value":903},{"type":757,"value":1929}," (декларация), ",{"type":752,"tag":766,"props":1931,"children":1933},{"className":1932},[],[1934],{"type":757,"value":903},{"type":757,"value":1936}," как выражение, стрелочная функция ",{"type":752,"tag":766,"props":1938,"children":1940},{"className":1939},[],[1941],{"type":757,"value":1326},{"type":757,"value":1943},", методы в объектах и классах, генераторы ",{"type":752,"tag":766,"props":1945,"children":1947},{"className":1946},[],[1948],{"type":757,"value":911},{"type":757,"value":1950},", асинхронные функции ",{"type":752,"tag":766,"props":1952,"children":1954},{"className":1953},[],[1955],{"type":757,"value":918},{"type":757,"value":1957}," и динамическое создание через ",{"type":752,"tag":766,"props":1959,"children":1961},{"className":1960},[],[1962],{"type":757,"value":1540},{"type":757,"value":1964},", при этом ",{"type":752,"tag":766,"props":1966,"children":1968},{"className":1967},[],[1969],{"type":757,"value":1540},{"type":757,"value":1971}," следует рассматривать как редкий и потенциально рискованный вариант.",1775735661826]