Concat creates a shallow copy of an existing array that includes any arguments you pass to it. In this lesson, we look at using concat for adding additional values to an array then cover some more useful features such as accepting other arrays as arguments & how to chain concat with other array methods such as forEach
Would someone be able to tell me what web editor Shane Osbourne uses during his Array videos? It looks like a really nice simple left / right "repl" output using NodeJS, but i'm not sure which one it is and wanted to try it. Thanks for your time and patience and all of you keep up the great work! - Frankie
Hi Francesco
It's just https://www.jetbrains.com/webstorm/
Then I have a run configuration setup to a key binding, so at any point I can hit CMD + SHIFT + P and the current file will be executed using Node
Thanks Shane, that in itself seems like a really cool little video tip. Awesome stuff :)
Hi Francesco
It's just https://www.jetbrains.com/webstorm/
Then I have a run configuration setup to a key binding, so at any point I can hit CMD + SHIFT + P and the current file will be executed using Node
Any chance you can tell us how to set that up? Looks very convenient
Hello Shane, how could i use concat, but append items to the start of the array?
@alejandropereira
You can apply the concat method to the array which should come first, and supply the other array as an argument. Example:
let arr = [[1, 2, 3]]
arr.concat([[4, 5, 6]]) // [[1, 2, 3, 4, 5, 6]]
[[4, 5, 6]].concat(arr) // [[4, 5, 6, 1, 2, 3]]
Hope that helps