javascript - 如何从控制台 chrome 复制地图对象?
问题描述
我想从 chrome 中的控制台复制以角度创建的地图:
Map(7) {1 => {…}, 2 => {…}, 3 => {…}, 4 => {…}, 5 => {…}, …}
我无法完整复制此地图!
解决方案
我假设你想复制地图条目,你可以使用 chrome 的copy
命令。
// create large amount of entries as an example
const entries = Array(100).fill(null).map((_, i) => [i, i]);
const map = new Map(entries);
// this would copy the map's entries to clipboard
copy(Array.from(map));
推荐阅读
- python-3.x - 使用 selenium、python 和 whatsapp-web 等待元素显示和不显示
- laravel - PATCH 和 DELETE 方法用 axios 替换 Laravel 中的 GET
- python-3.x - 如何比较两个列表并将差异写入文件?Python3
- angular - 单独组件中的 CDK DropLists
- bash - 如何在 FOR 循环中正确处理 *(星号)?
- c++ - 如何强制 getline() 一次输入一行
- angular - 从 JSON 文件传递单个对象
- selenium - Selenium C# 成功运行测试,但在最后一次测试完成后,最后一次测试的浏览器保持打开状态
- bash - 为什么使用 || 而不是bash中的IF中的-o?
- python - 无法在 Python 中加载 HDF5 文件