[{"data":1,"prerenderedAt":1609},["ShallowReactive",2],{"$fNXRax8J24_yS2np1xGY3TiIWXIwqBca-8ALtgTPH01s":3,"$fMMUdSFktwQFqMVGPrTtt3EC5yheBp7PzwIqznamFcMo":117,"$f1Prj1xEczHja_-L7FyIGgRHd5_cSWHo7r6AE5aheAik":120,"$fc0LoAJgqXDLbKKd2JS_NpM4SuzBK8EycUXINSg09CKU":445,"$fM3ea55k6lKMPOTM84llDB26VSQDVVbxiQuSBFQw9P_c":448,"$fI5fDmvm-5tr9wcH0eHaKZa1j3y_FQIQaHHPqbZxAHJE":692,"mdc--e4jhd3-key":712,"mdc--86w0mr-key":730,"mdc-oygk84-key":764,"mdc--4cj7yx-key":787,"mdc-ba8ycp-key":807,"mdc-dz3t4w-key":827,"mdc-o45f06-key":860,"mdc--grblje-key":885,"mdc-em2rqf-key":941,"mdc--8gfkq2-key":1011,"mdc--1fqr0-key":1035,"mdc-hwz6en-key":1128,"mdc-re9pf0-key":1190,"mdc-nmnytp-key":1211,"mdc-1u336k-key":1289,"mdc-58hrjn-key":1419,"mdc-86x27b-key":1504,"mdc--6sd674-key":1533,"mdc--45sjbv-key":1571},{"content":4,"quizQuestionContent":86,"type":105,"pageMeta":106},[5,9,13,17,20,24,27,31,35,38,42,45,49,52,56,59,63,66,70,73,76,80,83],{"id":6,"value":7,"isTypeH1":8},"1941","Что выведет консоль в случае удаления элемента массива с помощью оператора delete?",true,{"id":10,"value":11,"anchor":12,"isTypeH2":8},"4490","Теория по задаче","theory-on-the-task",{"id":14,"value":15,"anchor":16,"isTypeH3":8},"4511","Исходный код и фактический результат","original-code-and-observed-output",{"id":18,"value":19,"isTypeParagraph":8},"10327","Дан код:\n\n```\nconst c = [1, 2, 4];\ndelete c[\"1\"];\n\nconsole.log(c); // Первый\nconsole.log(c.length); // Второй\n```\n\nПосле выполнения `delete c[\"1\"]`:\n- в массиве появляется “пустой слот” (дырка) на позиции `1`\n- значение `length` не пересчитывается и остаётся равным 3",{"id":21,"value":22,"anchor":23,"isTypeH3":8},"4512","Теория: массив — это объект со свойствами","theory-array-is-an-object-with-properties",{"id":25,"value":26,"isTypeParagraph":8},"10328","В JavaScript массив является объектом, у которого:\n- индексы — это свойства с ключами-строками `\"0\"`, `\"1\"`, `\"2\"` и т.д.\n- `length` — отдельное числовое свойство, связанное с наибольшим индексом, но не равное количеству реально существующих элементов\n\nПоэтому обращение к элементу `c[1]` фактически означает доступ к свойству `\"1\"` у объекта массива.",{"id":28,"description":29,"titleAlert":30,"isTypeAlertInfo":8},"679","Выражения `c[1]` и `c[\"1\"]` в данном контексте эквивалентны, так как индекс при обращении к свойству преобразуется к строке.\n",null,{"id":32,"value":33,"anchor":34,"isTypeH3":8},"4513","Что именно делает delete","what-delete-actually-does",{"id":36,"value":37,"isTypeParagraph":8},"10329","Оператор `delete` удаляет свойство у объекта, а не “сдвигает элементы” и не “удаляет ячейку массива” в бытовом смысле.\n\nВыполняется следующее:\n- было свойство `\"1\"` со значением `2`\n- `delete` удаляет именно свойство `\"1\"`\n- свойство `length` при этом не изменяется\n\nИменно из-за этого массив становится разрежённым (sparse array): между `\"0\"` и `\"2\"` появляется отсутствующее свойство `\"1\"`.",{"id":39,"value":40,"anchor":41,"isTypeH3":8},"4514","“Пустой слот” (empty) и undefined — не одно и то же","empty-slot-vs-undefined",{"id":43,"value":44,"isTypeParagraph":8},"10330","Важно различать две ситуации:\n1) Свойство существует и в нём лежит `undefined`\n2) Свойства не существует вообще (пустой слот)\n\nВ обоих случаях чтение `c[1]` вернёт `undefined`, но поведение в проверках и переборах отличается.\n\nПример различий:\n\n```\nconst a = [1, 2, 4];\ndelete a[1];\n\nconst b = [1, undefined, 4];\n\na[1]; // undefined\nb[1]; // undefined\n\n1 in a; // false\n1 in b; // true\n\na.hasOwnProperty(\"1\"); // false\nb.hasOwnProperty(\"1\"); // true\n\na.length; // 3\nb.length; // 3\n```",{"id":46,"value":47,"anchor":48,"isTypeH3":8},"4515","Почему console.log показывает empty, а не undefined","why-console-shows-empty",{"id":50,"value":51,"isTypeParagraph":8},"10331","При выводе массива многие консоли разработчика стараются отобразить разрежённость массива явно, показывая отсутствующие элементы как `empty` (или “\u003C1 empty item>”).\n\nЭто визуальное представление “дырок”, а не реальных значений.\n",{"id":53,"value":54,"anchor":55,"isTypeH3":8},"4516","Почему length остаётся 3","why-length-stays-3",{"id":57,"value":58,"isTypeParagraph":8},"10332","Свойство `length` не является “счётчиком элементов”. Оно отражает \\(maxIndex + 1\\), где \\(maxIndex\\) — наибольший индекс, который когда-либо присутствует (или присутствует сейчас) в массиве, с учётом специальных правил изменения `length`.\n\nВ данном массиве есть индекс `\"2\"`, значит:\n- максимальный индекс \\(= 2\\)\n- `length` \\(= 2 + 1 = 3\\)\n\nУдаление `\"1\"` не меняет наличие `\"2\"`, поэтому `length` остаётся \\(3\\).",{"id":60,"value":61,"anchor":62,"isTypeH3":8},"4517","Мини-таблица: delete vs undefined","delete-vs-undefined-table",{"id":64,"value":65,"isTypeParagraph":8},"10333","| Ситуация | Что хранится в ячейке 1 | Возврат при чтении `arr[1]` | `1 in arr` | Визуально в console |\n|---|---|---|---|---|\n| `delete arr[1]` | Свойства нет (дырка) | `undefined` | false | empty |\n| `arr[1] = undefined` | Свойство есть, значение `undefined` | `undefined` | true | undefined |\n",{"id":67,"value":68,"anchor":69,"isTypeH3":8},"4518","Связанные нюансы перебора","iteration-nuances",{"id":71,"value":72,"isTypeParagraph":8},"10334","Разрежённость влияет на методы и циклы:\n- `forEach`, `map`, `filter` обычно пропускают пустые слоты\n- `for...in` перечисляет существующие свойства, поэтому пропустит отсутствующий `\"1\"`\n- обычный цикл `for (let i = 0; i \u003C arr.length; i++)` пройдёт по индексам, но на дырке чтение даст `undefined`\n\nПример:\n\n```\nconst c = [1, 2, 4];\ndelete c[1];\n\nc.forEach((v, i) => console.log(i, v)); // выведет 0 1 и 2 4, индекс 1 будет пропущен\n\nfor (let i = 0; i \u003C c.length; i++) {\n  console.log(i, c[i]); // выведет 0 1, 1 undefined, 2 4\n}\n```\n",{"id":74,"description":75,"titleAlert":30,"isTypeAlertWarning":8},"738","Создание разрежённых массивов часто усложняет логику и отладку, поэтому для “удаления элемента” в прикладных задачах обычно применяются `splice`, `filter` или построение нового массива, а не `delete`.",{"id":77,"value":78,"anchor":79,"isTypeH3":8},"4519","Что было бы, если нужна именно “удаление элемента”","if-you-need-remove-element-not-hole",{"id":81,"value":82,"isTypeParagraph":8},"10335","Если требуется убрать элемент и сдвинуть хвост влево (и уменьшить длину), применяется `splice`:\n\n```\nconst c = [1, 2, 4];\nc.splice(1, 1);\n\nconsole.log(c); // [1, 4]\nconsole.log(c.length); // 2\n```\n\nЕсли требуется удалить по условию без изменения исходного массива, часто создаётся новый массив:\n\n```\nconst c = [1, 2, 4];\nconst d = c.filter((x, i) => i !== 1);\n\nconsole.log(d); // [1, 4]\n```",{"id":84,"value":85,"isTypeParagraph":8},"10336","Итого: `delete c[\"1\"]` удаляет свойство `\"1\"` у массива, поэтому в выводе массива появляется пустой слот `[1, empty, 4]`, а `c.length` остаётся равным \\(3\\), поскольку длина не является количеством существующих элементов.",{"id":87,"options":88,"hint":102,"solution":103,"description":104},"1170",[89,92,96,99],{"id":90,"label":91,"isCorrect":8},"4824","Первый: `[1, empty, 4]`. Второй: `3`",{"id":93,"label":94,"isCorrect":95},"4825","Первый: `[1, undefined, 4]`. Второй: `3`",false,{"id":97,"label":98,"isCorrect":95},"4826","Первый: `[1, 2, 4]`. Второй: `3`",{"id":100,"label":101,"isCorrect":95},"4827","`Ошибка TypeError`","Следует помнить правило: `delete` по индексу массива удаляет свойство и создаёт “дырку”, а `length` при этом не меняется; консоль обычно показывает такую дырку как `empty`.","Правильный вариант: **1** - Первый: [1, empty, 4]. Второй: 3","Дан код:\n\n```\nconst c = [1, 2, 4];\ndelete c[\"1\"];\n\nconsole.log(c); // Первый\nconsole.log(c.length); // Второй\n```\n\nЧто выведетcя в ```console.log```-ах? ","quizQuestion",{"title":107,"description":108,"ogTitle":109,"ogDescription":108,"ogImageUrl":110,"canonical":30,"ogLocale":111,"ogSiteName":112,"ogImageType":113,"ogImageWidth":114,"ogImageHeight":115,"ogType":116,"ogUrl":30},"Удаление элемента массива с помощью оператора delete?","Разбор delete по индексу массива: «дырка» (empty slot) вместо undefined и неизменная длина массива.","Как работает delete с массивами и почему length не меняется","/og-image.png","ru_RU","goodwebjob.ru","image_jpeg","1200","630","article",{"siteName":118,"siteUrl":119},"GOOD WEB JOB!","https://goodwebjob.ru",{"slugs":121},[122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188,191,194,197,200,203,206,209,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,286,289,292,295,298,301,304,307,310,313,316,319,322,325,328,331,334,337,340,343,346,349,352,355,358,361,364,367,370,373,376,379,382,385,388,391,394,397,400,403,406,409,412,415,418,421,424,427,430,433,436,439,442],{"name":123,"value":124},"Теоретические задания","theoretical-tasks",{"name":126,"value":127},"Что вернёт этот код: typeof (function(){})()","what-this-code-will-return-typeof-function",{"name":129,"value":130},"С чего начать?","where-to-begin",{"name":132,"value":133},"Почему опасно писать прямо в прототипы базовых типов?","why-is-it-dangerous-to-write-directly-to-the-prototypes-of-basic-types",{"name":135,"value":136},"Backend","backend",{"name":138,"value":139},"Frontend","frontend",{"name":141,"value":142},"Какие логические значения в console.log будут получены?","prototype-what-logical-values-will-be-received-in-console-log",{"name":144,"value":145},"Нечётные числа должны отсортироваться по возрастанию, а чётные должны остаться на своих местах","odd-numbers-should-be-sorted-in-ascending-order-and-even-numbers-should-remain-in-their-original-positions",{"name":147,"value":148}," Найти в массиве неповторяющиеся числа","find-non-repeating-numbers-in-an-array",{"name":150,"value":151},"arr.push(0) повлияет на массив так же, как если бы мы выполнили...","arr-push-0-will-affect-the-array-in-the-same-way-as-if-we-performed",{"name":153,"value":154},"Дана строка: 'one.two.three.four.five'. Необходимо из строки сделать вложенный объект","the-string-one-two-three-four-five-is-given-it-is-necessary-to-make-a-nested-object-out-of-the-string",{"name":156,"value":157},"Реализовать функцию, похоже как в Jquery","implement-a-function-similar-to-jquery",{"name":159,"value":160},"Для каждого вложенного объекта нужно добавить свойство level, которое равняется числу - номер вложенности","for-each-nested-object-you-need-to-add-the-level-property-which-is-equal-to-a-number-the-nesting-number",{"name":162,"value":163},"Какое значение выведет консоль с object.property?","what-value-will-the-console-output-with-object-property",{"name":165,"value":166},"Что выведется в console.log([arr[0](), arr[0]()])?","what-will-be-displayed-in-console-log-arr-0-arr-0",{"name":168,"value":169},"Вернуть массив от 1 до n, где числа, кратные 3, заменены на 'fizz', кратные 5 - на 'buzz', а кратные и 3, и 5 одновременно - на 'fizzbuzz'","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":171,"value":172},"Необходимо проверить, являются ли две строки анаграммами друг друга","checks-whether-two-strings-are-anagrams-of-each-other",{"name":174,"value":175},"Определить, является ли слово палиндромом","determines-whether-a-word-is-a-palindrome",{"name":177,"value":178},"Есть массив, в котором лежат объекты с датами, необходимо отсортировать даты по возрастанию","there-is-an-array-containing-objects-with-dates-that-need-to-be-sorted-by-date",{"name":180,"value":181},"Реализовать функцию, принимающую аргументы \"*\", \"1\", \"b\", \"1c\" и возвращающую строку \"1*b*1c\"","implement-a-function-that-accepts-arguments-1-b-1c-and-the-return-string-1-b-1c",{"name":183,"value":184},"Дано дерево (вложенный объект), надо найти сумму всех вершин","given-a-tree-nested-object-it-is-necessary-to-find-the-sum-of-all-vertices",{"name":186,"value":187},"Для каждой ветви дерева записать номер вложенности данной ветви","for-each-branch-of-the-tree-write-down-the-nesting-number-of-this-branch",{"name":189,"value":190},"Есть слова в массиве, необходимо определить, состоят ли они из одних и тех же букв","there-are-words-in-the-array-it-is-necessary-to-determine-whether-they-consist-of-the-same-letters",{"name":192,"value":193},"Числа от 1 до 100 находятся в массиве, они хаотично перемешанные, но в нём не хватает одного числа из этой последовательности. Необходимо найти его","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":195,"value":196},"Есть строка, состоящая из разных скобок, необходимо проверить, закрыты ли все","there-is-a-string-consisting-of-different-brackets-it-is-necessary-to-check-whether-all-are-closed",{"name":198,"value":199},"Напишите функцию, который сделает из массива объект","write-a-function-that-will-make-an-object-out-of-an-array",{"name":201,"value":202},"Что выведет console.log в результате выполнения цикла while?","what-will-console-log-output-as-a-result-of-executing-the-while-loop",{"name":204,"value":205},"Есть функция и объект. Напишите все известные вам способы, чтобы вывести в консоли значение x из объекта, используя функцию","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":207,"value":208},"Что выведет консоль в случае присвоения свойства массиву по строковому отрицательному индексу?","what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-negative-string-index",{"name":7,"value":210},"what-will-the-console-output-if-an-array-element-is-deleted-using-the-delete-operator",{"name":212,"value":213},"Уникализация значений в массиве","unifying-values-in-an-array",{"name":215,"value":216},"«Расплющивание» массива","flattening-the-array",{"name":218,"value":219},"Что вернёт метод book.getUpperName()?","what-will-the-book-get-upper-name-method-return",{"name":221,"value":222},"Сжатие строк","string-compression",{"name":224,"value":225},"Что выведет консоль в случае присвоения свойства массиву по строковому положительному индексу?","what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-positive-string-index",{"name":227,"value":228},"Что получится в результате передачи объекта как аргумента в функцию и выполнения кода?","what-will-happen-when-an-object-is-passed-as-an-argument-to-a-function-and-the-code-is-executed",{"name":230,"value":231},"Как браузер после ввода домена понимает, откуда брать сайт?","how-does-the-browser-know-where-to-get-the-website-after-entering-the-domain",{"name":233,"value":234},"Как домен попадает в DNS в таблицу соответствия: домен – ip","how-does-a-domain-get-into-the-dns-mapping-table-domain-ip",{"name":236,"value":237},"Как браузер решает, какое соединение ему открывать, TCP или UDP?","how-does-a-browser-decide-whether-to-open-a-tcp-or-udp-connection",{"name":239,"value":240},"Ключевые отличия TCP и UDP","key-differences-between-tcp-and-udp",{"name":242,"value":243},"\"TCP/IP\" - кем является TCP, а кем IP в данном случае?","tcp-ip-who-is-tcp-and-who-is-ip-in-this-case",{"name":245,"value":246},"Что такое HTTP и из чего состоит?","what-is-http-and-what-does-it-consist-of",{"name":248,"value":249},"Что такое заголовки в HTTP и зачем они нужны?","what-are-http-headers-and-why-do-we-need-them",{"name":251,"value":252},"Что такое параметры в HTTP?","what-are-http-parameters",{"name":254,"value":255},"Где находится HTML-код в структуре HTTP-ответа?","where-is-the-html-code-located-in-the-http-response-structure",{"name":257,"value":258},"Что такое HTML?","what-is-html",{"name":260,"value":261},"Чем отличаются 1.0, 1.1, 2.0, 3.0 версии HTTP?","what-are-the-differences-between-http-versions-1-0-1-1-2-0-and-3-0",{"name":263,"value":264},"Пользователь авторизован на сайте. Как сервер узнает об этом с последующими другими заходами, что «я – авторизованный пользователь»?","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":266,"value":267},"Что такое cookie?","what-is-a-cookie",{"name":269,"value":270},"Кто является инициатором записи cookie в браузере?","who-initiates-the-cookie-recording-in-the-browser",{"name":272,"value":273},"Есть ли возможность с клиента (с браузера) управлять cookie?","is-it-possible-to-manage-cookies-from-the-client-browser",{"name":275,"value":276},"Лайвкодинг","livecoding",{"name":278,"value":279},"Что вернёт следующий код? Object.create(null).hasOwnProperty('toString')","what-will-the-following-code-return-object-create-null-has-own-property-to-string",{"name":281,"value":282},"Всё, что идет по HTTPS – оно защищено?","is-everything-that-goes-through-https-secure",{"name":284,"value":285},"Все данные зашифрованы, используется https. Хакер взламывает dns и делает подмену одного ip на другой, на фишинговый сайт. В этом случае, злоумышленник может получить данные (логин \\ пароль)?","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":287,"value":288},"Есть веб-приложение. Помимо HTTP, какие протоколы того же уровня (Application Layer) можно дополнительно использовать в веб-приложении в браузере?","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":290,"value":291},"Как браузер парсит JavaScript и изображения при рендеринге?","how-the-browser-parses-javascript-and-images-when-rendering",{"name":293,"value":294},"Что происходит, когда HTTP прислал HTML? Что браузер дальше делает c HTML с учетом того, что она валидная?","what-happens-when-http-sends-html-what-does-the-browser-do-with-this-html-given-that-it-is-valid",{"name":296,"value":297},"Что в браузере блокирует рендеринг страницы?","what-is-blocking-the-page-rendering-in-the-browser",{"name":299,"value":300},"Что такое DOM в браузере? Что такое CSSOM?","what-is-dom-in-a-browser-what-is-cssom",{"name":302,"value":303},"Что является узлами в DOM?","what-are-nodes-in-the-dom",{"name":305,"value":306},"Из чего состоит CSSOM?","what-does-cssom-consist-of",{"name":308,"value":309},"Дан HTML-код. Какой будет цвет у текста «Some dummy text»?","the-html-code-is-given-what-will-be-the-color-of-the-some-dummy-text",{"name":311,"value":312},"Есть шаблон HTML и CSS кода. Какой будет цвет у текста «Таким образом, постоянное»?","there-is-a-template-for-html-and-css-code-what-color-will-the-text-thus-constant-have",{"name":314,"value":315},"Есть шаблон вложенного HTML кода. Какой будет цвет у текста «One more dummy text»?","there-is-a-template-for-embedded-html-code-what-will-be-the-color-of-the-one-more-dummy-text",{"name":317,"value":318},"Есть шаблон вложенного HTML кода. Будет ли display:block у body влиять на span?","there-is-a-template-for-embedded-html-code-will-there-be-a-display-does-bodys-block-affect-span",{"name":320,"value":321},"Есть HTML код. Будет ли font-weight на span влиять?","there-is-an-html-code-will-font-weight-affect-span",{"name":323,"value":324},"Flexbox и Grid, чем отличаются друг от друга?","what-are-the-differences-between-flexbox-and-grid",{"name":326,"value":327},"Заменяют ли Flexbox и Grid друг друга?","do-flexbox-and-grid-replace-each-other",{"name":329,"value":330},"Есть CSS и JS анимация. Какая между ними разница, что быстрее, что более удобно?","there-are-css-and-js-animations-what-is-the-difference-between-them-and-which-is-faster-and-more-convenient",{"name":332,"value":333},"Сборник задач","tasks",{"name":335,"value":336},"Какие способы объявления функции есть в JavaScript?","what-are-the-ways-to-declare-a-function-in-javascript",{"name":338,"value":339},"Что такое this в JavaScript?","what-is-this-in-javascript",{"name":341,"value":342},"Что такое Event Loop, как работает?","what-is-an-event-loop-and-how-does-it-work",{"name":344,"value":345},"Что будет, если вызвать typeof на необъявленной переменной?","what-happens-if-you-call-typeof-on-an-undeclared-variable",{"name":347,"value":348},"Что показывает оператор typeof в JavaScript?","what-does-the-typeof-operator-show-in-javascript",{"name":350,"value":351},"Какие типы данных существует в JavaScript?","what-types-of-data-exist-in-javascript",{"name":353,"value":354},"Какую структуру использовать для хранения упорядоченного списка строк в JavaScript?","what-is-the-best-structure-to-use-for-storing-an-ordered-list-of-strings-in-javascript",{"name":356,"value":357},"Что вернет typeof для массива?","what-will-typeof-return-for-an-array",{"name":359,"value":360},"Почему оператор typeof, применённый к массиву, возвращает объект?","why-does-the-typeof-operator-applied-to-an-array-return-an-object",{"name":362,"value":363},"Если нужно хранить список уникальных строк, какую структуру данных выбрать?","if-you-need-to-store-a-list-of-unique-strings-which-data-structure-should-i-choose",{"name":365,"value":366},"Что возвращает typeof для new Set в JavaScript?","what-does-typeof-return-for-new-set-in-javascript",{"name":368,"value":369},"Для чего нужен React, какие он решает проблемы?","what-is-react-used-for-and-what-problems-does-it-solve",{"name":371,"value":372},"Если убрать в React VDOM/Fiber, и вручную изменять DOM, разве это не оптимально?","if-you-remove-the-vdom-fiber-in-react-and-manually-change-the-dom-isn-t-that-optimal",{"name":374,"value":375},"Есть блок кода. Что в реальном DOM изменится после нажатия на кнопку?","there-is-a-block-of-code-what-changes-in-the-real-dom-after-clicking-the-button",{"name":377,"value":378},"Есть код, в котором список и кнопка. Что в реальном DOM изменится после нажатия на кнопку?","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":380,"value":381},"Зачем нужен Redux (Mobx/Effector)? Зачем нужен менеджер состояния? Какие проблемы решает?","why-do-we-need-redux-mobx-effector-why-do-we-need-a-state-manager-what-problems-does-it-solve",{"name":383,"value":384},"Как диагностировать и исправить нежелательное изменение цвета фона по клику на кнопку, если исходный код сайта запутан и недоступен для прямого чтения?","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":386,"value":387},"Разрабатывал, взял закоммитил, запушил. Оказалось, что запушил не в ту ветку, точнее, коммит не в ту ветку. Какие действия?","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":389,"value":390},"В git есть несколько вариантов слияния веток, какие? Чем отличаются?","git-has-several-options-for-merging-branches-which-ones-how-are-they-different",{"name":392,"value":393},"Какие существуют стратегии ветвления для работы команды? Что это такое?","what-are-the-branching-strategies-for-the-team-what-is-it",{"name":395,"value":396},"По каким характеристикам, ревьюер понимает, что данный код - хороший, а этот код - плохой?","how-does-a-reviewer-know-which-code-is-good-and-which-code-is-bad",{"name":398,"value":399},"Дан фрагмент bash-скрипта: cd ~; mkdir foo... Что в нем происходит?","here-is-a-fragment-of-a-bash-script-cd-mkdir-foo-what-is-happening-in-this-script",{"name":401,"value":402},"Дан фрагмент bash-скрипта: target=$(ps -Af | grep $1 | head -n 1)...","here-is-a-fragment-of-a-bash-script-target-ps-af-grep-1-head-n-1",{"name":404,"value":405},"Что такое алгоритмическая сложность?","what-is-algorithmic-complexity",{"name":407,"value":408},"Какая алгоритмическая сложность у \"быстрой сортировки\"?","what-is-the-algorithmic-complexity-of-quick-sort",{"name":410,"value":411},"Почему в JavaScript два объекта с одинаковым содержимым при сравнении возвращают false?","why-do-two-objects-with-the-same-content-return-false-when-compared-in-javascript",{"name":413,"value":414},"Каким способом может выполняться авторизация пользователя на сайте?","how-can-a-user-be-authorized-on-a-website",{"name":416,"value":417},"В чем разница между микро- и макро-тасками в JavaScript?","what-is-the-difference-between-micro-and-macro-tasks-in-javascript",{"name":419,"value":420},"В комнате три человека. Какова вероятность того, что хотя бы двое из них одного пола? То есть два и более.","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":422,"value":423},"Есть монета. Ее подбрасывают пять раз подряд. Каждый раз записывается, что выпало - орел или решка. Сколько разных последовательностей орлов и решек может при этом получиться?","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":425,"value":426},"Как гарантированно найти лёгкую фальшивую монету среди 8 за минимальное число взвешиваний на чашечных весах?","how-can-you-guarantee-to-find-an-easy-fake-coin-among-8-in-the-minimum-number-of-weighings-on-a-balance-scale",{"name":428,"value":429},"Подготовка к тех.интервью","technical-interview",{"name":431,"value":432},"Верно ли утверждение, что злоумышленник, контролирующий роутер и прослушивающий трафик, может получить логины и пароли от сайтов, на которые заходит клиент?","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":434,"value":435},"Что такое DNS, как DNS находит нужный IP-адрес?","what-is-dns-and-how-does-dns-find-the-correct-ip-address",{"name":437,"value":438},"Переменные объявлены следующим образом: a=3; b=«hello»;. Укажите правильное утверждение","variables-are-declared-as-follows-specify-the-correct-statement",{"name":440,"value":441},"Какой механизм лежит в основе оптимизации обновлений DOM в React?","what-is-the-underlying-mechanism-for-optimizing-dom-updates-in-react",{"name":443,"value":444},"Что мешает организовать централизованное состояние без менеджера состояния? Если организовать состояние механизмами реакта: контекстом, стейтом, в чем проблема? Что менеджеры состояния привносят?","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",[446],{"label":428,"slug":429,"to":447},"/technical-interview/where-to-begin",{"navigationList":449,"navigationSublist":455},[450,452],{"path":447,"isActive":95,"name":129,"icon":451,"isNavbarMobileDisabled":8},"material-symbols:visibility-outline-rounded",{"path":453,"isActive":8,"name":332,"icon":454,"isNavbarMobileDisabled":95},"/technical-interview/tasks","material-symbols:task-outline",[456,463,482,491,496,591,608,615,620,663,678,683],{"title":457,"list":458,"isOpened":95},"Bash",[459,461],{"name":398,"path":460,"isActive":95},"/technical-interview/tasks/here-is-a-fragment-of-a-bash-script-cd-mkdir-foo-what-is-happening-in-this-script",{"name":401,"path":462,"isActive":95},"/technical-interview/tasks/here-is-a-fragment-of-a-bash-script-target-ps-af-grep-1-head-n-1",{"title":464,"list":465,"isOpened":95},"CSS",[466,468,470,472,474,476,478,480],{"name":308,"path":467,"isActive":95},"/technical-interview/tasks/the-html-code-is-given-what-will-be-the-color-of-the-some-dummy-text",{"name":311,"path":469,"isActive":95},"/technical-interview/tasks/there-is-a-template-for-html-and-css-code-what-color-will-the-text-thus-constant-have",{"name":314,"path":471,"isActive":95},"/technical-interview/tasks/there-is-a-template-for-embedded-html-code-what-will-be-the-color-of-the-one-more-dummy-text",{"name":317,"path":473,"isActive":95},"/technical-interview/tasks/there-is-a-template-for-embedded-html-code-will-there-be-a-display-does-bodys-block-affect-span",{"name":320,"path":475,"isActive":95},"/technical-interview/tasks/there-is-an-html-code-will-font-weight-affect-span",{"name":323,"path":477,"isActive":95},"/technical-interview/tasks/what-are-the-differences-between-flexbox-and-grid",{"name":326,"path":479,"isActive":95},"/technical-interview/tasks/do-flexbox-and-grid-replace-each-other",{"name":329,"path":481,"isActive":95},"/technical-interview/tasks/there-are-css-and-js-animations-what-is-the-difference-between-them-and-which-is-faster-and-more-convenient",{"title":483,"list":484,"isOpened":95},"Git",[485,487,489],{"name":386,"path":486,"isActive":95},"/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":389,"path":488,"isActive":95},"/technical-interview/tasks/git-has-several-options-for-merging-branches-which-ones-how-are-they-different",{"name":392,"path":490,"isActive":95},"/technical-interview/tasks/what-are-the-branching-strategies-for-the-team-what-is-it",{"title":492,"list":493,"isOpened":95},"HTML",[494],{"name":257,"path":495,"isActive":95},"/technical-interview/tasks/what-is-html",{"title":497,"list":498,"isOpened":95},"JavaScript",[499,501,503,505,507,509,511,513,515,517,519,521,523,525,527,529,531,533,535,537,539,541,543,545,547,549,551,553,555,557,559,561,563,565,567,569,571,573,575,577,579,581,583,585,587,589],{"name":141,"path":500,"isActive":95},"/technical-interview/tasks/prototype-what-logical-values-will-be-received-in-console-log",{"name":132,"path":502,"isActive":95},"/technical-interview/tasks/why-is-it-dangerous-to-write-directly-to-the-prototypes-of-basic-types",{"name":278,"path":504,"isActive":95},"/technical-interview/tasks/what-will-the-following-code-return-object-create-null-has-own-property-to-string",{"name":162,"path":506,"isActive":95},"/technical-interview/tasks/what-value-will-the-console-output-with-object-property",{"name":165,"path":508,"isActive":95},"/technical-interview/tasks/what-will-be-displayed-in-console-log-arr-0-arr-0",{"name":201,"path":510,"isActive":95},"/technical-interview/tasks/what-will-console-log-output-as-a-result-of-executing-the-while-loop",{"name":204,"path":512,"isActive":95},"/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":218,"path":514,"isActive":95},"/technical-interview/tasks/what-will-the-book-get-upper-name-method-return",{"name":437,"path":516,"isActive":95},"/technical-interview/tasks/variables-are-declared-as-follows-specify-the-correct-statement",{"name":224,"path":518,"isActive":95},"/technical-interview/tasks/what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-positive-string-index",{"name":207,"path":520,"isActive":95},"/technical-interview/tasks/what-will-the-console-display-if-a-property-is-assigned-to-an-array-using-a-negative-string-index",{"name":7,"path":522,"isActive":95},"/technical-interview/tasks/what-will-the-console-output-if-an-array-element-is-deleted-using-the-delete-operator",{"name":126,"path":524,"isActive":95},"/technical-interview/tasks/what-this-code-will-return-typeof-function",{"name":227,"path":526,"isActive":95},"/technical-interview/tasks/what-will-happen-when-an-object-is-passed-as-an-argument-to-a-function-and-the-code-is-executed",{"name":335,"path":528,"isActive":95},"/technical-interview/tasks/what-are-the-ways-to-declare-a-function-in-javascript",{"name":338,"path":530,"isActive":95},"/technical-interview/tasks/what-is-this-in-javascript",{"name":341,"path":532,"isActive":95},"/technical-interview/tasks/what-is-an-event-loop-and-how-does-it-work",{"name":344,"path":534,"isActive":95},"/technical-interview/tasks/what-happens-if-you-call-typeof-on-an-undeclared-variable",{"name":347,"path":536,"isActive":95},"/technical-interview/tasks/what-does-the-typeof-operator-show-in-javascript",{"name":350,"path":538,"isActive":95},"/technical-interview/tasks/what-types-of-data-exist-in-javascript",{"name":353,"path":540,"isActive":95},"/technical-interview/tasks/what-is-the-best-structure-to-use-for-storing-an-ordered-list-of-strings-in-javascript",{"name":356,"path":542,"isActive":95},"/technical-interview/tasks/what-will-typeof-return-for-an-array",{"name":359,"path":544,"isActive":95},"/technical-interview/tasks/why-does-the-typeof-operator-applied-to-an-array-return-an-object",{"name":362,"path":546,"isActive":95},"/technical-interview/tasks/if-you-need-to-store-a-list-of-unique-strings-which-data-structure-should-i-choose",{"name":365,"path":548,"isActive":95},"/technical-interview/tasks/what-does-typeof-return-for-new-set-in-javascript",{"name":410,"path":550,"isActive":95},"/technical-interview/tasks/why-do-two-objects-with-the-same-content-return-false-when-compared-in-javascript",{"name":416,"path":552,"isActive":95},"/technical-interview/tasks/what-is-the-difference-between-micro-and-macro-tasks-in-javascript",{"name":150,"path":554,"isActive":95},"/technical-interview/tasks/arr-push-0-will-affect-the-array-in-the-same-way-as-if-we-performed",{"name":168,"path":556,"isActive":95},"/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":153,"path":558,"isActive":95},"/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":183,"path":560,"isActive":95},"/technical-interview/tasks/given-a-tree-nested-object-it-is-necessary-to-find-the-sum-of-all-vertices",{"name":159,"path":562,"isActive":95},"/technical-interview/tasks/for-each-nested-object-you-need-to-add-the-level-property-which-is-equal-to-a-number-the-nesting-number",{"name":186,"path":564,"isActive":95},"/technical-interview/tasks/for-each-branch-of-the-tree-write-down-the-nesting-number-of-this-branch",{"name":177,"path":566,"isActive":95},"/technical-interview/tasks/there-is-an-array-containing-objects-with-dates-that-need-to-be-sorted-by-date",{"name":189,"path":568,"isActive":95},"/technical-interview/tasks/there-are-words-in-the-array-it-is-necessary-to-determine-whether-they-consist-of-the-same-letters",{"name":195,"path":570,"isActive":95},"/technical-interview/tasks/there-is-a-string-consisting-of-different-brackets-it-is-necessary-to-check-whether-all-are-closed",{"name":147,"path":572,"isActive":95},"/technical-interview/tasks/find-non-repeating-numbers-in-an-array",{"name":198,"path":574,"isActive":95},"/technical-interview/tasks/write-a-function-that-will-make-an-object-out-of-an-array",{"name":171,"path":576,"isActive":95},"/technical-interview/tasks/checks-whether-two-strings-are-anagrams-of-each-other",{"name":144,"path":578,"isActive":95},"/technical-interview/tasks/odd-numbers-should-be-sorted-in-ascending-order-and-even-numbers-should-remain-in-their-original-positions",{"name":174,"path":580,"isActive":95},"/technical-interview/tasks/determines-whether-a-word-is-a-palindrome",{"name":215,"path":582,"isActive":95},"/technical-interview/tasks/flattening-the-array",{"name":180,"path":584,"isActive":95},"/technical-interview/tasks/implement-a-function-that-accepts-arguments-1-b-1c-and-the-return-string-1-b-1c",{"name":221,"path":586,"isActive":95},"/technical-interview/tasks/string-compression",{"name":212,"path":588,"isActive":95},"/technical-interview/tasks/unifying-values-in-an-array",{"name":192,"path":590,"isActive":95},"/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":592,"list":593,"isOpened":95},"React",[594,596,598,600,602,604,606],{"name":368,"path":595,"isActive":95},"/technical-interview/tasks/what-is-react-used-for-and-what-problems-does-it-solve",{"name":440,"path":597,"isActive":95},"/technical-interview/tasks/what-is-the-underlying-mechanism-for-optimizing-dom-updates-in-react",{"name":371,"path":599,"isActive":95},"/technical-interview/tasks/if-you-remove-the-vdom-fiber-in-react-and-manually-change-the-dom-isn-t-that-optimal",{"name":374,"path":601,"isActive":95},"/technical-interview/tasks/there-is-a-block-of-code-what-changes-in-the-real-dom-after-clicking-the-button",{"name":377,"path":603,"isActive":95},"/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":380,"path":605,"isActive":95},"/technical-interview/tasks/why-do-we-need-redux-mobx-effector-why-do-we-need-a-state-manager-what-problems-does-it-solve",{"name":443,"path":607,"isActive":95},"/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":609,"list":610,"isOpened":95},"Алгоритмы",[611,613],{"name":404,"path":612,"isActive":95},"/technical-interview/tasks/what-is-algorithmic-complexity",{"name":407,"path":614,"isActive":95},"/technical-interview/tasks/what-is-the-algorithmic-complexity-of-quick-sort",{"title":616,"list":617,"isOpened":95},"Дебаггинг",[618],{"name":383,"path":619,"isActive":95},"/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":621,"list":622,"isOpened":95},"Компьютерные сети",[623,625,627,629,631,633,635,637,639,641,643,645,647,649,651,653,655,657,659,661],{"name":230,"path":624,"isActive":95},"/technical-interview/tasks/how-does-the-browser-know-where-to-get-the-website-after-entering-the-domain",{"name":434,"path":626,"isActive":95},"/technical-interview/tasks/what-is-dns-and-how-does-dns-find-the-correct-ip-address",{"name":233,"path":628,"isActive":95},"/technical-interview/tasks/how-does-a-domain-get-into-the-dns-mapping-table-domain-ip",{"name":236,"path":630,"isActive":95},"/technical-interview/tasks/how-does-a-browser-decide-whether-to-open-a-tcp-or-udp-connection",{"name":239,"path":632,"isActive":95},"/technical-interview/tasks/key-differences-between-tcp-and-udp",{"name":242,"path":634,"isActive":95},"/technical-interview/tasks/tcp-ip-who-is-tcp-and-who-is-ip-in-this-case",{"name":245,"path":636,"isActive":95},"/technical-interview/tasks/what-is-http-and-what-does-it-consist-of",{"name":248,"path":638,"isActive":95},"/technical-interview/tasks/what-are-http-headers-and-why-do-we-need-them",{"name":251,"path":640,"isActive":95},"/technical-interview/tasks/what-are-http-parameters",{"name":254,"path":642,"isActive":95},"/technical-interview/tasks/where-is-the-html-code-located-in-the-http-response-structure",{"name":260,"path":644,"isActive":95},"/technical-interview/tasks/what-are-the-differences-between-http-versions-1-0-1-1-2-0-and-3-0",{"name":263,"path":646,"isActive":95},"/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":266,"path":648,"isActive":95},"/technical-interview/tasks/what-is-a-cookie",{"name":269,"path":650,"isActive":95},"/technical-interview/tasks/who-initiates-the-cookie-recording-in-the-browser",{"name":272,"path":652,"isActive":95},"/technical-interview/tasks/is-it-possible-to-manage-cookies-from-the-client-browser",{"name":431,"path":654,"isActive":95},"/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":281,"path":656,"isActive":95},"/technical-interview/tasks/is-everything-that-goes-through-https-secure",{"name":284,"path":658,"isActive":95},"/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":287,"path":660,"isActive":95},"/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":413,"path":662,"isActive":95},"/technical-interview/tasks/how-can-a-user-be-authorized-on-a-website",{"title":664,"list":665,"isOpened":95},"Отрисовка в браузере",[666,668,670,672,674,676],{"name":293,"path":667,"isActive":95},"/technical-interview/tasks/what-happens-when-http-sends-html-what-does-the-browser-do-with-this-html-given-that-it-is-valid",{"name":290,"path":669,"isActive":95},"/technical-interview/tasks/how-the-browser-parses-javascript-and-images-when-rendering",{"name":296,"path":671,"isActive":95},"/technical-interview/tasks/what-is-blocking-the-page-rendering-in-the-browser",{"name":299,"path":673,"isActive":95},"/technical-interview/tasks/what-is-dom-in-a-browser-what-is-cssom",{"name":302,"path":675,"isActive":95},"/technical-interview/tasks/what-are-nodes-in-the-dom",{"name":305,"path":677,"isActive":95},"/technical-interview/tasks/what-does-cssom-consist-of",{"title":679,"list":680,"isOpened":95},"Ревью кода",[681],{"name":395,"path":682,"isActive":95},"/technical-interview/tasks/how-does-a-reviewer-know-which-code-is-good-and-which-code-is-bad",{"title":684,"list":685,"isOpened":95},"Теория вероятности",[686,688,690],{"name":419,"path":687,"isActive":95},"/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":422,"path":689,"isActive":95},"/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":425,"path":691,"isActive":95},"/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",{"cooperation":693,"copyright":696,"reportError":697,"socialNetwork":699},{"link":694,"title":695},"https://t.me/baurinanton","Сотрудничество","© “GOOD WEB JOB!”",{"label":698,"link":694},"Сообщить об ошибке",{"label":700,"socialNetworkList":701},"Мы в соцсетях:",[702,705,708],{"icon":30,"link":703,"title":704},"https://max.ru/u/f9LHodD0cOKMaukdnnahTeL5pwvjrPfUaZ4S8_1rsNy9I9qsmc9Ar3kP_y8","Max",{"icon":706,"link":694,"title":707},"ic:baseline-telegram","Telegram",{"icon":709,"link":710,"title":711},"ri:vk-fill","https://vk.com/baurinanton","VK",{"data":713,"body":714},{},{"type":715,"children":716},"root",[717],{"type":718,"tag":719,"props":720,"children":721},"element","p",{},[722],{"type":718,"tag":723,"props":724,"children":726},"code",{"className":725},[],[727],{"type":728,"value":729},"text","Ошибка TypeError",{"data":731,"body":732},{},{"type":715,"children":733},[734,739,751],{"type":718,"tag":719,"props":735,"children":736},{},[737],{"type":728,"value":738},"Дан код:",{"type":718,"tag":740,"props":741,"children":745},"pre",{"className":742,"code":744,"language":728},[743],"language-text","const c = [1, 2, 4];\ndelete c[\"1\"];\n\nconsole.log(c); // Первый\nconsole.log(c.length); // Второй\n",[746],{"type":718,"tag":723,"props":747,"children":749},{"__ignoreMap":748},"",[750],{"type":728,"value":744},{"type":718,"tag":719,"props":752,"children":753},{},[754,756,762],{"type":728,"value":755},"Что выведетcя в ",{"type":718,"tag":723,"props":757,"children":759},{"className":758},[],[760],{"type":728,"value":761},"console.log",{"type":728,"value":763},"-ах?",{"data":765,"body":766},{},{"type":715,"children":767},[768],{"type":718,"tag":719,"props":769,"children":770},{},[771,773,779,781],{"type":728,"value":772},"Первый: ",{"type":718,"tag":723,"props":774,"children":776},{"className":775},[],[777],{"type":728,"value":778},"[1, empty, 4]",{"type":728,"value":780},". Второй: ",{"type":718,"tag":723,"props":782,"children":784},{"className":783},[],[785],{"type":728,"value":786},"3",{"data":788,"body":789},{},{"type":715,"children":790},[791],{"type":718,"tag":719,"props":792,"children":793},{},[794,795,801,802],{"type":728,"value":772},{"type":718,"tag":723,"props":796,"children":798},{"className":797},[],[799],{"type":728,"value":800},"[1, undefined, 4]",{"type":728,"value":780},{"type":718,"tag":723,"props":803,"children":805},{"className":804},[],[806],{"type":728,"value":786},{"data":808,"body":809},{},{"type":715,"children":810},[811],{"type":718,"tag":719,"props":812,"children":813},{},[814,815,821,822],{"type":728,"value":772},{"type":718,"tag":723,"props":816,"children":818},{"className":817},[],[819],{"type":728,"value":820},"[1, 2, 4]",{"type":728,"value":780},{"type":718,"tag":723,"props":823,"children":825},{"className":824},[],[826],{"type":728,"value":786},{"data":828,"body":829},{},{"type":715,"children":830},[831],{"type":718,"tag":719,"props":832,"children":833},{},[834,836,842,844,850,852,858],{"type":728,"value":835},"Следует помнить правило: ",{"type":718,"tag":723,"props":837,"children":839},{"className":838},[],[840],{"type":728,"value":841},"delete",{"type":728,"value":843}," по индексу массива удаляет свойство и создаёт “дырку”, а ",{"type":718,"tag":723,"props":845,"children":847},{"className":846},[],[848],{"type":728,"value":849},"length",{"type":728,"value":851}," при этом не меняется; консоль обычно показывает такую дырку как ",{"type":718,"tag":723,"props":853,"children":855},{"className":854},[],[856],{"type":728,"value":857},"empty",{"type":728,"value":859},".",{"data":861,"body":862},{},{"type":715,"children":863},[864],{"type":718,"tag":719,"props":865,"children":866},{},[867,869,875,877,883],{"type":728,"value":868},"Правильный вариант: ",{"type":718,"tag":870,"props":871,"children":872},"strong",{},[873],{"type":728,"value":874},"1",{"type":728,"value":876}," - Первый: ",{"type":718,"tag":878,"props":879,"children":880},"span",{},[881],{"type":728,"value":882},"1, empty, 4",{"type":728,"value":884},". Второй: 3",{"data":886,"body":887},{},{"type":715,"children":888},[889,893,901,914],{"type":718,"tag":719,"props":890,"children":891},{},[892],{"type":728,"value":738},{"type":718,"tag":740,"props":894,"children":896},{"className":895,"code":744,"language":728},[743],[897],{"type":718,"tag":723,"props":898,"children":899},{"__ignoreMap":748},[900],{"type":728,"value":744},{"type":718,"tag":719,"props":902,"children":903},{},[904,906,912],{"type":728,"value":905},"После выполнения ",{"type":718,"tag":723,"props":907,"children":909},{"className":908},[],[910],{"type":728,"value":911},"delete c[\"1\"]",{"type":728,"value":913},":",{"type":718,"tag":915,"props":916,"children":917},"ul",{},[918,929],{"type":718,"tag":919,"props":920,"children":921},"li",{},[922,924],{"type":728,"value":923},"в массиве появляется “пустой слот” (дырка) на позиции ",{"type":718,"tag":723,"props":925,"children":927},{"className":926},[],[928],{"type":728,"value":874},{"type":718,"tag":919,"props":930,"children":931},{},[932,934,939],{"type":728,"value":933},"значение ",{"type":718,"tag":723,"props":935,"children":937},{"className":936},[],[938],{"type":728,"value":849},{"type":728,"value":940}," не пересчитывается и остаётся равным 3",{"data":942,"body":943},{},{"type":715,"children":944},[945,950,991],{"type":718,"tag":719,"props":946,"children":947},{},[948],{"type":728,"value":949},"В JavaScript массив является объектом, у которого:",{"type":718,"tag":915,"props":951,"children":952},{},[953,981],{"type":718,"tag":919,"props":954,"children":955},{},[956,958,964,966,972,973,979],{"type":728,"value":957},"индексы — это свойства с ключами-строками ",{"type":718,"tag":723,"props":959,"children":961},{"className":960},[],[962],{"type":728,"value":963},"\"0\"",{"type":728,"value":965},", ",{"type":718,"tag":723,"props":967,"children":969},{"className":968},[],[970],{"type":728,"value":971},"\"1\"",{"type":728,"value":965},{"type":718,"tag":723,"props":974,"children":976},{"className":975},[],[977],{"type":728,"value":978},"\"2\"",{"type":728,"value":980}," и т.д.",{"type":718,"tag":919,"props":982,"children":983},{},[984,989],{"type":718,"tag":723,"props":985,"children":987},{"className":986},[],[988],{"type":728,"value":849},{"type":728,"value":990}," — отдельное числовое свойство, связанное с наибольшим индексом, но не равное количеству реально существующих элементов",{"type":718,"tag":719,"props":992,"children":993},{},[994,996,1002,1004,1009],{"type":728,"value":995},"Поэтому обращение к элементу ",{"type":718,"tag":723,"props":997,"children":999},{"className":998},[],[1000],{"type":728,"value":1001},"c[1]",{"type":728,"value":1003}," фактически означает доступ к свойству ",{"type":718,"tag":723,"props":1005,"children":1007},{"className":1006},[],[1008],{"type":728,"value":971},{"type":728,"value":1010}," у объекта массива.",{"data":1012,"body":1013},{},{"type":715,"children":1014},[1015],{"type":718,"tag":719,"props":1016,"children":1017},{},[1018,1020,1025,1027,1033],{"type":728,"value":1019},"Выражения ",{"type":718,"tag":723,"props":1021,"children":1023},{"className":1022},[],[1024],{"type":728,"value":1001},{"type":728,"value":1026}," и ",{"type":718,"tag":723,"props":1028,"children":1030},{"className":1029},[],[1031],{"type":728,"value":1032},"c[\"1\"]",{"type":728,"value":1034}," в данном контексте эквивалентны, так как индекс при обращении к свойству преобразуется к строке.",{"data":1036,"body":1037},{},{"type":715,"children":1038},[1039,1051,1056,1104],{"type":718,"tag":719,"props":1040,"children":1041},{},[1042,1044,1049],{"type":728,"value":1043},"Оператор ",{"type":718,"tag":723,"props":1045,"children":1047},{"className":1046},[],[1048],{"type":728,"value":841},{"type":728,"value":1050}," удаляет свойство у объекта, а не “сдвигает элементы” и не “удаляет ячейку массива” в бытовом смысле.",{"type":718,"tag":719,"props":1052,"children":1053},{},[1054],{"type":728,"value":1055},"Выполняется следующее:",{"type":718,"tag":915,"props":1057,"children":1058},{},[1059,1077,1092],{"type":718,"tag":919,"props":1060,"children":1061},{},[1062,1064,1069,1071],{"type":728,"value":1063},"было свойство ",{"type":718,"tag":723,"props":1065,"children":1067},{"className":1066},[],[1068],{"type":728,"value":971},{"type":728,"value":1070}," со значением ",{"type":718,"tag":723,"props":1072,"children":1074},{"className":1073},[],[1075],{"type":728,"value":1076},"2",{"type":718,"tag":919,"props":1078,"children":1079},{},[1080,1085,1087],{"type":718,"tag":723,"props":1081,"children":1083},{"className":1082},[],[1084],{"type":728,"value":841},{"type":728,"value":1086}," удаляет именно свойство ",{"type":718,"tag":723,"props":1088,"children":1090},{"className":1089},[],[1091],{"type":728,"value":971},{"type":718,"tag":919,"props":1093,"children":1094},{},[1095,1097,1102],{"type":728,"value":1096},"свойство ",{"type":718,"tag":723,"props":1098,"children":1100},{"className":1099},[],[1101],{"type":728,"value":849},{"type":728,"value":1103}," при этом не изменяется",{"type":718,"tag":719,"props":1105,"children":1106},{},[1107,1109,1114,1115,1120,1122,1127],{"type":728,"value":1108},"Именно из-за этого массив становится разрежённым (sparse array): между ",{"type":718,"tag":723,"props":1110,"children":1112},{"className":1111},[],[1113],{"type":728,"value":963},{"type":728,"value":1026},{"type":718,"tag":723,"props":1116,"children":1118},{"className":1117},[],[1119],{"type":728,"value":978},{"type":728,"value":1121}," появляется отсутствующее свойство ",{"type":718,"tag":723,"props":1123,"children":1125},{"className":1124},[],[1126],{"type":728,"value":971},{"type":728,"value":859},{"data":1129,"body":1130},{},{"type":715,"children":1131},[1132,1137,1157,1176,1181],{"type":718,"tag":719,"props":1133,"children":1134},{},[1135],{"type":728,"value":1136},"Важно различать две ситуации:",{"type":718,"tag":1138,"props":1139,"children":1140},"ol",{},[1141,1152],{"type":718,"tag":919,"props":1142,"children":1143},{},[1144,1146],{"type":728,"value":1145},"Свойство существует и в нём лежит ",{"type":718,"tag":723,"props":1147,"children":1149},{"className":1148},[],[1150],{"type":728,"value":1151},"undefined",{"type":718,"tag":919,"props":1153,"children":1154},{},[1155],{"type":728,"value":1156},"Свойства не существует вообще (пустой слот)",{"type":718,"tag":719,"props":1158,"children":1159},{},[1160,1162,1167,1169,1174],{"type":728,"value":1161},"В обоих случаях чтение ",{"type":718,"tag":723,"props":1163,"children":1165},{"className":1164},[],[1166],{"type":728,"value":1001},{"type":728,"value":1168}," вернёт ",{"type":718,"tag":723,"props":1170,"children":1172},{"className":1171},[],[1173],{"type":728,"value":1151},{"type":728,"value":1175},", но поведение в проверках и переборах отличается.",{"type":718,"tag":719,"props":1177,"children":1178},{},[1179],{"type":728,"value":1180},"Пример различий:",{"type":718,"tag":740,"props":1182,"children":1185},{"className":1183,"code":1184,"language":728},[743],"const a = [1, 2, 4];\ndelete a[1];\n\nconst b = [1, undefined, 4];\n\na[1]; // undefined\nb[1]; // undefined\n\n1 in a; // false\n1 in b; // true\n\na.hasOwnProperty(\"1\"); // false\nb.hasOwnProperty(\"1\"); // true\n\na.length; // 3\nb.length; // 3\n",[1186],{"type":718,"tag":723,"props":1187,"children":1188},{"__ignoreMap":748},[1189],{"type":728,"value":1184},{"data":1191,"body":1192},{},{"type":715,"children":1193},[1194,1206],{"type":718,"tag":719,"props":1195,"children":1196},{},[1197,1199,1204],{"type":728,"value":1198},"При выводе массива многие консоли разработчика стараются отобразить разрежённость массива явно, показывая отсутствующие элементы как ",{"type":718,"tag":723,"props":1200,"children":1202},{"className":1201},[],[1203],{"type":728,"value":857},{"type":728,"value":1205}," (или “\u003C1 empty item>”).",{"type":718,"tag":719,"props":1207,"children":1208},{},[1209],{"type":728,"value":1210},"Это визуальное представление “дырок”, а не реальных значений.",{"data":1212,"body":1213},{},{"type":715,"children":1214},[1215,1233,1245,1263],{"type":718,"tag":719,"props":1216,"children":1217},{},[1218,1220,1225,1227,1232],{"type":728,"value":1219},"Свойство ",{"type":718,"tag":723,"props":1221,"children":1223},{"className":1222},[],[1224],{"type":728,"value":849},{"type":728,"value":1226}," не является “счётчиком элементов”. Оно отражает (maxIndex + 1), где (maxIndex) — наибольший индекс, который когда-либо присутствует (или присутствует сейчас) в массиве, с учётом специальных правил изменения ",{"type":718,"tag":723,"props":1228,"children":1230},{"className":1229},[],[1231],{"type":728,"value":849},{"type":728,"value":859},{"type":718,"tag":719,"props":1234,"children":1235},{},[1236,1238,1243],{"type":728,"value":1237},"В данном массиве есть индекс ",{"type":718,"tag":723,"props":1239,"children":1241},{"className":1240},[],[1242],{"type":728,"value":978},{"type":728,"value":1244},", значит:",{"type":718,"tag":915,"props":1246,"children":1247},{},[1248,1253],{"type":718,"tag":919,"props":1249,"children":1250},{},[1251],{"type":728,"value":1252},"максимальный индекс (= 2)",{"type":718,"tag":919,"props":1254,"children":1255},{},[1256,1261],{"type":718,"tag":723,"props":1257,"children":1259},{"className":1258},[],[1260],{"type":728,"value":849},{"type":728,"value":1262}," (= 2 + 1 = 3)",{"type":718,"tag":719,"props":1264,"children":1265},{},[1266,1268,1273,1275,1280,1282,1287],{"type":728,"value":1267},"Удаление ",{"type":718,"tag":723,"props":1269,"children":1271},{"className":1270},[],[1272],{"type":728,"value":971},{"type":728,"value":1274}," не меняет наличие ",{"type":718,"tag":723,"props":1276,"children":1278},{"className":1277},[],[1279],{"type":728,"value":978},{"type":728,"value":1281},", поэтому ",{"type":718,"tag":723,"props":1283,"children":1285},{"className":1284},[],[1286],{"type":728,"value":849},{"type":728,"value":1288}," остаётся (3).",{"data":1290,"body":1291},{},{"type":715,"children":1292},[1293],{"type":718,"tag":1294,"props":1295,"children":1296},"table",{},[1297,1341],{"type":718,"tag":1298,"props":1299,"children":1300},"thead",{},[1301],{"type":718,"tag":1302,"props":1303,"children":1304},"tr",{},[1305,1311,1316,1327,1336],{"type":718,"tag":1306,"props":1307,"children":1308},"th",{},[1309],{"type":728,"value":1310},"Ситуация",{"type":718,"tag":1306,"props":1312,"children":1313},{},[1314],{"type":728,"value":1315},"Что хранится в ячейке 1",{"type":718,"tag":1306,"props":1317,"children":1318},{},[1319,1321],{"type":728,"value":1320},"Возврат при чтении ",{"type":718,"tag":723,"props":1322,"children":1324},{"className":1323},[],[1325],{"type":728,"value":1326},"arr[1]",{"type":718,"tag":1306,"props":1328,"children":1329},{},[1330],{"type":718,"tag":723,"props":1331,"children":1333},{"className":1332},[],[1334],{"type":728,"value":1335},"1 in arr",{"type":718,"tag":1306,"props":1337,"children":1338},{},[1339],{"type":728,"value":1340},"Визуально в console",{"type":718,"tag":1342,"props":1343,"children":1344},"tbody",{},[1345,1380],{"type":718,"tag":1302,"props":1346,"children":1347},{},[1348,1358,1363,1371,1376],{"type":718,"tag":1349,"props":1350,"children":1351},"td",{},[1352],{"type":718,"tag":723,"props":1353,"children":1355},{"className":1354},[],[1356],{"type":728,"value":1357},"delete arr[1]",{"type":718,"tag":1349,"props":1359,"children":1360},{},[1361],{"type":728,"value":1362},"Свойства нет (дырка)",{"type":718,"tag":1349,"props":1364,"children":1365},{},[1366],{"type":718,"tag":723,"props":1367,"children":1369},{"className":1368},[],[1370],{"type":728,"value":1151},{"type":718,"tag":1349,"props":1372,"children":1373},{},[1374],{"type":728,"value":1375},"false",{"type":718,"tag":1349,"props":1377,"children":1378},{},[1379],{"type":728,"value":857},{"type":718,"tag":1302,"props":1381,"children":1382},{},[1383,1392,1402,1410,1415],{"type":718,"tag":1349,"props":1384,"children":1385},{},[1386],{"type":718,"tag":723,"props":1387,"children":1389},{"className":1388},[],[1390],{"type":728,"value":1391},"arr[1] = undefined",{"type":718,"tag":1349,"props":1393,"children":1394},{},[1395,1397],{"type":728,"value":1396},"Свойство есть, значение ",{"type":718,"tag":723,"props":1398,"children":1400},{"className":1399},[],[1401],{"type":728,"value":1151},{"type":718,"tag":1349,"props":1403,"children":1404},{},[1405],{"type":718,"tag":723,"props":1406,"children":1408},{"className":1407},[],[1409],{"type":728,"value":1151},{"type":718,"tag":1349,"props":1411,"children":1412},{},[1413],{"type":728,"value":1414},"true",{"type":718,"tag":1349,"props":1416,"children":1417},{},[1418],{"type":728,"value":1151},{"data":1420,"body":1421},{},{"type":715,"children":1422},[1423,1428,1490,1495],{"type":718,"tag":719,"props":1424,"children":1425},{},[1426],{"type":728,"value":1427},"Разрежённость влияет на методы и циклы:",{"type":718,"tag":915,"props":1429,"children":1430},{},[1431,1456,1472],{"type":718,"tag":919,"props":1432,"children":1433},{},[1434,1440,1441,1447,1448,1454],{"type":718,"tag":723,"props":1435,"children":1437},{"className":1436},[],[1438],{"type":728,"value":1439},"forEach",{"type":728,"value":965},{"type":718,"tag":723,"props":1442,"children":1444},{"className":1443},[],[1445],{"type":728,"value":1446},"map",{"type":728,"value":965},{"type":718,"tag":723,"props":1449,"children":1451},{"className":1450},[],[1452],{"type":728,"value":1453},"filter",{"type":728,"value":1455}," обычно пропускают пустые слоты",{"type":718,"tag":919,"props":1457,"children":1458},{},[1459,1465,1467],{"type":718,"tag":723,"props":1460,"children":1462},{"className":1461},[],[1463],{"type":728,"value":1464},"for...in",{"type":728,"value":1466}," перечисляет существующие свойства, поэтому пропустит отсутствующий ",{"type":718,"tag":723,"props":1468,"children":1470},{"className":1469},[],[1471],{"type":728,"value":971},{"type":718,"tag":919,"props":1473,"children":1474},{},[1475,1477,1483,1485],{"type":728,"value":1476},"обычный цикл ",{"type":718,"tag":723,"props":1478,"children":1480},{"className":1479},[],[1481],{"type":728,"value":1482},"for (let i = 0; i \u003C arr.length; i++)",{"type":728,"value":1484}," пройдёт по индексам, но на дырке чтение даст ",{"type":718,"tag":723,"props":1486,"children":1488},{"className":1487},[],[1489],{"type":728,"value":1151},{"type":718,"tag":719,"props":1491,"children":1492},{},[1493],{"type":728,"value":1494},"Пример:",{"type":718,"tag":740,"props":1496,"children":1499},{"className":1497,"code":1498,"language":728},[743],"const c = [1, 2, 4];\ndelete c[1];\n\nc.forEach((v, i) => console.log(i, v)); // выведет 0 1 и 2 4, индекс 1 будет пропущен\n\nfor (let i = 0; i \u003C c.length; i++) {\n  console.log(i, c[i]); // выведет 0 1, 1 undefined, 2 4\n}\n",[1500],{"type":718,"tag":723,"props":1501,"children":1502},{"__ignoreMap":748},[1503],{"type":728,"value":1498},{"data":1505,"body":1506},{},{"type":715,"children":1507},[1508],{"type":718,"tag":719,"props":1509,"children":1510},{},[1511,1513,1519,1520,1525,1527,1532],{"type":728,"value":1512},"Создание разрежённых массивов часто усложняет логику и отладку, поэтому для “удаления элемента” в прикладных задачах обычно применяются ",{"type":718,"tag":723,"props":1514,"children":1516},{"className":1515},[],[1517],{"type":728,"value":1518},"splice",{"type":728,"value":965},{"type":718,"tag":723,"props":1521,"children":1523},{"className":1522},[],[1524],{"type":728,"value":1453},{"type":728,"value":1526}," или построение нового массива, а не ",{"type":718,"tag":723,"props":1528,"children":1530},{"className":1529},[],[1531],{"type":728,"value":841},{"type":728,"value":859},{"data":1534,"body":1535},{},{"type":715,"children":1536},[1537,1548,1557,1562],{"type":718,"tag":719,"props":1538,"children":1539},{},[1540,1542,1547],{"type":728,"value":1541},"Если требуется убрать элемент и сдвинуть хвост влево (и уменьшить длину), применяется ",{"type":718,"tag":723,"props":1543,"children":1545},{"className":1544},[],[1546],{"type":728,"value":1518},{"type":728,"value":913},{"type":718,"tag":740,"props":1549,"children":1552},{"className":1550,"code":1551,"language":728},[743],"const c = [1, 2, 4];\nc.splice(1, 1);\n\nconsole.log(c); // [1, 4]\nconsole.log(c.length); // 2\n",[1553],{"type":718,"tag":723,"props":1554,"children":1555},{"__ignoreMap":748},[1556],{"type":728,"value":1551},{"type":718,"tag":719,"props":1558,"children":1559},{},[1560],{"type":728,"value":1561},"Если требуется удалить по условию без изменения исходного массива, часто создаётся новый массив:",{"type":718,"tag":740,"props":1563,"children":1566},{"className":1564,"code":1565,"language":728},[743],"const c = [1, 2, 4];\nconst d = c.filter((x, i) => i !== 1);\n\nconsole.log(d); // [1, 4]\n",[1567],{"type":718,"tag":723,"props":1568,"children":1569},{"__ignoreMap":748},[1570],{"type":728,"value":1565},{"data":1572,"body":1573},{},{"type":715,"children":1574},[1575],{"type":718,"tag":719,"props":1576,"children":1577},{},[1578,1580,1585,1587,1592,1594,1599,1601,1607],{"type":728,"value":1579},"Итого: ",{"type":718,"tag":723,"props":1581,"children":1583},{"className":1582},[],[1584],{"type":728,"value":911},{"type":728,"value":1586}," удаляет свойство ",{"type":718,"tag":723,"props":1588,"children":1590},{"className":1589},[],[1591],{"type":728,"value":971},{"type":728,"value":1593}," у массива, поэтому в выводе массива появляется пустой слот ",{"type":718,"tag":723,"props":1595,"children":1597},{"className":1596},[],[1598],{"type":728,"value":778},{"type":728,"value":1600},", а ",{"type":718,"tag":723,"props":1602,"children":1604},{"className":1603},[],[1605],{"type":728,"value":1606},"c.length",{"type":728,"value":1608}," остаётся равным (3), поскольку длина не является количеством существующих элементов.",1775735655417]