0

I don't know how I can store the length of an array by using es6 object destructuring:

const length = this.props.options.length;
user2952265
  • 1,590
  • 7
  • 21
  • 32
  • 1
    Possible Duplicate of [/es6-how-to-destructure-from-an-object-](https://stackoverflow.com/questions/44343763/es6-how-to-destructure-from-an-object-with-a-string-key/44343796#44343796) – Shubham Khatri Mar 05 '18 at 10:59
  • 1
    check this https://stackoverflow.com/questions/42595907/how-does-destructuring-array-get-length-property it would be helpful – Jayavel Mar 05 '18 at 11:04

1 Answers1

1

The syntax is like this:

const { length } = this.props.options
Stretch0
  • 8,362
  • 13
  • 71
  • 133