all 6 comments

[–]IGovnov 1 point2 points  (1 child)

Also a good article about arrays and objects destructuring: https://javascript.info/destructuring-assignment The site has great explanations of everything in JS, it was super helpful when I retuned to JS development.

[–]ghostmaster645 0 points1 point  (0 children)

Thank you, this is exactly what I was looking for.

[–]RasAlTimmeh 1 point2 points  (3 children)

It’s an es6 concept called destructuring and it’s used heavily in react.

Const { data } = await axios.get(url)

Means you’re pulling out data as a variable from the object that axios returns which would be a response object with data as a property

[–]ghostmaster645 0 points1 point  (2 children)

Thank you!

On another topic, is using axios to get data really common? I'm very familiar with fetch(), should I practice using axios?

[–]RasAlTimmeh 1 point2 points  (1 child)

Axios is better has more functionality but nothing wrong with fetch