chinchang / chinchang/screenlog.js

Objects log incorrectly

Open
#1 3 comments 0 reactions 1 assignee Claimed by @chinchang View on GitHub
Dominant language
JavaScript
Stars
854
Forks
71
PR merge metrics
No merged PRs in 30d

Description

Whenever I log an object all I get is

``` javascript
[object Object]
```

I fixed this myself by adding this code on line 30

``` javascript
for (var i = arguments.length - 1; i >= 0; i--) {
if(typeof arguments[i] == 'object' && !Array.isArray(arguments[i]))
arguments[i] = JSON.stringify(arguments[i]).replace(/"/g, "").replace(/,/g, ', ').replace(/:/g, ': ');
};
```

This is obviously not the best way to fix this issue, but the use of JSON.stringify might save you some headaches.

This happens in chrome(46.0.2490).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.