Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTom Cluster
297 PointsDestructuring can also be easily used in the current set method!
set name(input) {
let name = input.split(' ');
this.firstName = name[0];
this.lastName = name[1];
}
Preceding set
method can be easily written with a previously learned destructuring:
set name(input) {
[this.firstName, this.lastName] = input.split(' ');
}
Mike Hickman
19,817 PointsPretty sweet!
Muhammad Umar
7,817 PointsNice!!! Thank you for sharing.
David Bath
25,940 PointsDavid Bath
25,940 PointsBravo!