This question is so basic, yet I have no idea of the answer.
Why screen
object when stringified returns empty?
Does this mean JSON.stringify()
needs read/write access to the input?
let a = {foo: 'one', bar: 2};
console.log(JSON.stringify(a));
console.log(JSON.stringify(screen));
This question is so basic, yet I have no idea of the answer.
Why screen
object when stringified returns empty?
Does this mean JSON.stringify()
needs read/write access to the input?
let a = {foo: 'one', bar: 2};
console.log(JSON.stringify(a));
console.log(JSON.stringify(screen));
Share
Improve this question
edited Jul 27, 2018 at 11:30
Lemures
asked Jul 27, 2018 at 11:07
LemuresLemures
4825 silver badges11 bronze badges
4
- 1 @Variable developer.mozilla/en-US/docs/Web/API/Window/screen . If it was never declared you'd get an error about it being undefined. – ADyson Commented Jul 27, 2018 at 11:10
- 7 Possible duplicate of Stringify DOMWindow object – user202729 Commented Jul 27, 2018 at 11:11
- @ADyson Thanks, didn't knew about this, learned something new :D.