Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log('List base - ' + JSON.stringify(this.listBase));
- const getCircularReplacer = () => {
- const seen = new WeakSet();
- return (key, value) => {
- if (typeof value === "object" && value !== null) {
- if (seen.has(value)) {
- return;
- }
- seen.add(value);
- }
- return value;
- };
- };
- console.log(JSON.stringify(this.listBase, getCircularReplacer()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement