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 trialweixin yang
312 PointsCan you only assign string in array or variable too
Can you only assign string in array or variable too.
1 Answer
dexterthedoggo
7,025 PointsYes, you can actually assign both in the same array as well, for example var cat = [1,"dog","mouse"]
when you print cat it comes out as "[1, string, peace, 234]"
You can do all of what he did in this video with the array I mentioned above as well.
Michael Pastran
4,727 PointsMichael Pastran
4,727 Pointsyeah you can assign both into an array.
let array [1,2,3]
or
let array ["One", "Two", "Three']