Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add console.inspect() API for inspecting JavaScript Objects. (#691
) Add a new Console API for inspecting complex JavaScript objects. Example: ```javascript const json = { name: 1, age: '2', map: new Map(), set: new Set(), fn: function() { return 1; }, undefined: undefined, null: null, nest: { nest: {aa: { arr: [1,2,3,4,5]}}} }; json.map['name'] = new Map(); json.set.add(1); json.set.add(2); json.map['name']['age'] = [1,2,3,4,5]; console.inspect(json, 2, 3,4); ``` Result: ``` { name: 1, age: '2', map: Map { name: Map { age: [1, 2, 3, 4, 5] } }, set: Set {1, 2}, fn: Function { length: 0, name: 'fn', prototype: { constructor: # } }, undefined: undefined, null: null, nest: { nest: { aa: { arr: [1, 2, 3, 4, 5] } } } } 2 3 4 ```
- Loading branch information