question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement or Improve Concept Exercise: object-destructuring

See original GitHub issue

Getting started

Here you can read about what Concept Exercises are and how they are structured:

If you have not done so yet, it is probably also helpful to do a couple of “Learning Exercises” (this is how they are called on the site) yourself. You can also look at the code of an existing concept exercise like bird-watcher (concept for-loops) for reference.

See the documentation above (general documentation), as well as How to implement a Concept Exercise in JavaScript.

Goal

The goal of this exercise is to teach the student how they can destructure an object into multiple bindings (which looks like pattern matching), concept object-destructuring.

Learning objectives

Out of scope

  • Anything specific with arrays because there is another concept for this

Concepts

  • object-destructuring

Prerequisites

  • objects
  • array-destructuring
  • … (do you think something is missing?)

About

  • Usage in the parameters directly,
  • Usage when extracting data from e.g. a JSON response
  • Usage in e.g. React

Help

You can choose to do this solo-style, or collaborate with multiple people on this. The suggested approach is to

  1. First accept this issue by saying “I’d like to work on this” (no need to wait for a response, just go with it) and optionally request that someone works with you (and wait for a second person to accept your request).
  2. Use this issue to discuss any questions you have, what should be included in the content and what not and to collect reference material.
  3. Create a PR and set “exercism/javascript” as reviewers. Additionally you can write in #maintaining-javascript that your PR is ready for review. Once you incorporated any critical feedback that the reviewer might give you and the PR is approved, it will be merged by a maintainer.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikSchierboomcommented, Sep 1, 2021

@ErikSchierboom please advice. These are two concepts, which can be used on their own, but not when learning/teaching. It makes absolute sense to have them separately for exercises, but not when teaching the concept itself.

However, we could argue that, because you learn them all together here, that for us it’s just ‘one concept’. In that case, I need help with the name (probably still object-descructuring). The counter part is array-destructuring).

@SleeplessByte I’d have the exercise be named after the primary concept (which looks to be object-destructuring) and have it unlock two concepts: object-destructuring and rest-properties.

0reactions
junedevcommented, Nov 7, 2021

There is a fresh issue for this now (https://github.com/exercism/javascript/issues/1501), I am closing this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object destructuring best practice in Javascript | by Crunch Tech
Object destructuring best practice in Javascript. A summary of the evolution of object property access patterns at Crunch.
Read more >
How to Use Object Destructuring in JavaScript - Dmitri Pavlutin
The object destructuring is a JavaScript feature to extract properties from objects and bind them to variables.
Read more >
Destructuring Assignment | Advanced JavaScript
Destructuring assignment is syntax in JavaScript that allows you to unpack values from arrays or properties from objects, and save them into variables....
Read more >
Destructuring assignment - The Modern JavaScript Tutorial
Destructuring assignment is a special syntax that allows us to “unpack” arrays or objects into a bunch of variables, as sometimes that's more ......
Read more >
How to use destructuring in JavaScript to write cleaner, more ...
With destructuring we have to get the values of all the properties present inside the object inside the location array. So we created...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found