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 trial

JavaScript JavaScript Arrays Multidimensional Arrays What is a Multidimensional Array?

Where are slice and splice?

I looked at the chapter headings and don't see this under "array" anywhere. Are they covered under a later section? It seems like being able to pinpoint the exact element you want to delete, the the place you want to insert something would be really important, but perhaps I don't understand fully how arrays get used.

4 Answers

Danny L.
Danny L.
10,837 Points

MDN has great examples on this. It took me a while to get it as well but the syntax is explained very well. Please let me know if you need any more help:

Slice: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice

Splice: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice

Some good video sources as well: https://www.youtube.com/watch?v=MeZVVxLn26E *skip to 03:26 for slice and splice

https://www.youtube.com/watch?v=pCqfbzj2iLY

Thank you for this. Although I didnt like the video with 03:26 where it gets confusing when he spoke about " -1 " but the link below made more sense of him saying " up to but NOT that # " instead of " -1 "

Hi Daniel - I have read the MDN site and watched a couple videos on them, I was curious why they weren't covered in the course here. Thanks for posting the info!

Danny L.
Danny L.
10,837 Points

My pleasure Henry.

Yeah, sometimes that happens here. I don't remember exactly if they were covered or not but I think somethings just fall through the cracks as they work to update video content. Regardless, getting comfortable with checking MDN is always a good habit.

As a side note that freecodecamp channel has great video tutorials and they've been a great help.

In case you're ever looking for help on YouTube these are my top favorite channels that I always recommend to people:

freecodecamp Web Dev Simplified Fun Fun Function Programming with Mosh Telusko

Yeah, I'm familiar with both. Want to bolster information as many ways as possible. I do like the layout here. Curious if they are updating or simply ending Django?

I'd also like to see them get a C++ course, and some more in depth games courses might be nice.

They are not discussed up to this point as of yet.

At what point are they discussed?