Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Tags
#javascript
Question

How to get the counts out of cagingIt as ct1, ct2, ct3 using destructuring in javascript?

let cagingIt = {
      foo: {
        bar: 'Nick Cage',
        counts: [1, 2, 3]
      }
    };
Answer

let { foo: {counts: [ ct1, ct2, ct3 ]} } = cagingIt;
console.log(ct2); // prints 2

In this example, foo is referring to the property name "foo".
Following the colon, we then use counts which refers to the property "counts".

Then use array destructuring and store those values as well.

Consider that destructuring is not null-safe so it is risky to use this way.


Tags
#javascript
Question

How to get the counts out of cagingIt as ct1, ct2, ct3 using destructuring in javascript?

let cagingIt = {
      foo: {
        bar: 'Nick Cage',
        counts: [1, 2, 3]
      }
    };
Answer
?

Tags
#javascript
Question

How to get the counts out of cagingIt as ct1, ct2, ct3 using destructuring in javascript?

let cagingIt = {
      foo: {
        bar: 'Nick Cage',
        counts: [1, 2, 3]
      }
    };
Answer

let { foo: {counts: [ ct1, ct2, ct3 ]} } = cagingIt;
console.log(ct2); // prints 2

In this example, foo is referring to the property name "foo".
Following the colon, we then use counts which refers to the property "counts".

Then use array destructuring and store those values as well.

Consider that destructuring is not null-safe so it is risky to use this way.


Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.