Well splice seems interesting
danielarmbruster0314
Posted on March 1, 2022
So me and my peer discovered in our boot camp lab today that If you use the .splice() method on an array and want to use it to make a copy with an additional element at the end of the array ( exp. Arr.splice(start, deletecount, new element added).)
You kind of have to know the length of the array because it adds the new element to the left indexs of the specified starting point so .splice(-1,0,”newstring”)will add the new string an index before the final element in the array and not at the end of the array. Wild, just wild. Any comments to expand my understanding of this method is more than welcome.
💖 💪 🙅 🚩
danielarmbruster0314
Posted on March 1, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.