32
rated 0 times
[
36]
[
4]
/ answers: 1 / hits: 18337
/ 9 Years ago, fri, august 7, 2015, 12:00:00
I'm sure there are many ways to achieve that but I'm looking for something elegant.
a = [
'a',
'b',
'c'
];
magicArrayJoin(a, {value: 255} ); // insert the same object between each item
result == [
'a',
{value: 255},
'b',
{value: 255}
'c'
];
All proposals are welcome. :)
More From » arrays