cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

how do i combine arrays in javascript

mbohanon
1-Newbie

how do i combine arrays in javascript

ids = new Array()

.

.

ids.concat(bean.getRelatedIssues("relationship");

does not work

1 ACCEPTED SOLUTION

Accepted Solutions
LLawton
14-Alexandrite
(To:mbohanon)

The concat function doesn't modify its operand, you have to assign the results of concat to a variable.

You can do a direct assignment:

var ids = bean.getRelatedIssues("relationship");

Or if you must add to an array:

ids = ids.concat( bean.getRelatedIssues("relationship") );

View solution in original post

1 REPLY 1
LLawton
14-Alexandrite
(To:mbohanon)

The concat function doesn't modify its operand, you have to assign the results of concat to a variable.

You can do a direct assignment:

var ids = bean.getRelatedIssues("relationship");

Or if you must add to an array:

ids = ids.concat( bean.getRelatedIssues("relationship") );

Top Tags