如何从控制台版边复制地图对象?



我想从chrome中的控制台复制在angular中创建的地图:

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));

最新更新