Skip to content

Commit

Permalink
update(JS): web/javascript/reference/global_objects/json/parse (#3798)
Browse files Browse the repository at this point in the history
* update(JS): web/javascript/reference/global_objects/json/parse

* chore: функції-відроджувача

---------

Co-authored-by: Vitalii Perehonchuk <[email protected]>
  • Loading branch information
undead404 and viperehonchuk authored Feb 3, 2025
1 parent 7e92077 commit d911640
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const jsonText = JSON.stringify(map, (key, value) =>
console.log(jsonText);
// [[1,"один"],[2,"два"],[3,"три"]]
const map2 = JSON.parse(jsonText, (key, value) =>
Array.isArray(value) ? new Map(value) : value,
Array.isArray(value) && value.every(Array.isArray) ? new Map(value) : value,
);
console.log(map2);
// Map { 1 => "один", 2 => "два", 3 => "три" }
Expand Down
1 change: 1 addition & 0 deletions uk_spelling_additions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@
функцією-виконавцем
функції-виконавці
функції-вирішувача
функції-відроджувача
функції-обробника
функції-обробники
функції-сетери
Expand Down

0 comments on commit d911640

Please sign in to comment.