Jump to content

JavaScript Array Methods (Merging an Array with Values) example doesn't use array


Schnappi

Recommended Posts

The JavaScript Array Methods (Merging an Array with Values) example doesn't use array in it's example, it still uses an array like in the examples above it.

The square brackets in the argument to concat should be removed, leaving 3 separate string arguments.

I think example could be improved to something like:

var arr1 = ["Cecilie", "Lone"];
var nephew = "Nick";
var myChildren = arr1.concat("Emil", "Tobias", "Linus", nephew); 

 

Link to comment
Share on other sites

On which page is the example?

If there is a mistake on the site, click on the "REPORT ERROR" link at the bottom of the page that has the mistake so that the W3Schools staff will see it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...