0

I have a structure:

var j = { a: { optional: true, type: 'string' },
  b: { optional: true, type: 'string' },
  c: { optional: true, type: 'string' } 
}

How to iterate trough each element so that is printing on a screen as a new line ?

Thanks.

Joe
  • 10,493
  • 23
  • 85
  • 159
  • I got a structure like that from another service.. Also that 'duplicate' does not deal with nested... – Joe Mar 08 '19 at 00:49
  • ```for (var key in j) { if (j.hasOwnProperty(key)) { console.log(key); } } ``` – Joe Mar 19 '19 at 18:27

0 Answers0