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 trialThomas Scott
7,682 PointsSay you have two arrays, itemsA and itemsB...not sure how to put them together in the way the question asks?
Not sure how to put them together in the way the question asks? The question makes you put the arrays inside the new array to create a 2D array, maybe it is a syntax thing. Thanks in advance!
1 Answer
Peter Vann
36,427 PointsHi Thomas!
You'll want to use the spread operator:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
https://davidwalsh.name/spread-operator
https://codeburst.io/javascript-es6-the-spread-syntax-f5c35525f754
More info (on ES6):
https://teamtreehouse.com/library/introducing-es2015
https://teamtreehouse.com/library/getting-started-with-es2015-2
http://es6-features.org/#Constants
I hope that helps.
Stay safe and happy coding!