Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unwrap Objects while Logging them as Desktop Notifications #7

Open
mattpilott opened this issue Oct 14, 2016 · 3 comments
Open

Unwrap Objects while Logging them as Desktop Notifications #7

mattpilott opened this issue Oct 14, 2016 · 3 comments

Comments

@mattpilott
Copy link

Hey,

Great idea on the script! As far as unwrapping objects would you just use JSON.stringify?

@hkirat
Copy link
Owner

hkirat commented Oct 14, 2016

Thanks
Seems like a good fix. Didn't knew something like this existed.

@jarifibrahim
Copy link
Contributor

@hkirat Using JSON.stringify will result in outputs like

JSON.stringify([1, 'false', false]); // '[1,"false",false]'

JSON.stringify(new Date(2006, 0, 2, 15, 4, 5)) 
// '"2006-01-02T15:04:05.000Z"'

JSON.stringify({ x: 5, y: 6 });
// '{"x":5,"y":6}' or '{"y":6,"x":5}'
JSON.stringify([new Number(1), new String('false'), new Boolean(false)]);
// '[1,"false",false]'

JSON.stringify({ x: [10, undefined, function(){}, Symbol('')] }); 
// '{"x":[10,null,null,null]}' 

Is this what we're trying to achieve?

@hkirat
Copy link
Owner

hkirat commented Oct 18, 2016

@jarifibrahim What we really want to achieve is something like we have in the js console in our browsers.
That is, an arrow on the left when the current variable is an array or an object clicking on which it will expand it so that we can see the contents inside

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants