bahmutov / bahmutov/console.table

object whose properties are objects

Open
#19 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
139
Forks
16
PR merge metrics
No merged PRs in 30d

Description

There is an issue when printing objects whose properties are objects. For example:

```
function Person(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}

var family = {};

family.mother = new Person("Jane", "Smith");
family.father = new Person("John", "Smith");
family.daughter = new Person("Emily", "Smith");

console.table(family);
```

Results in:
```
key value
-------- ---------------
mother [object Object]
father [object Object]
daughter [object Object]
```
The expectation here is that there should be `firstName` and `lastName` columns.
More details can be found here: https://developer.mozilla.org/en-US/docs/Web/API/Console/table

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the nested-object example from the issue and compare the output with the linked MDN console.table behavior. Trace the repository's console.table entry point to see how object properties become columns; done means family displays firstName and lastName columns instead of [object Object].

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.