I want to add mongo ids in a final array from my query, here is what i am trying to do
var arr = [];
// array1 = [ "59ae3b20a8473d45d11987f8",
"59bb8a9c8f541e060054580e",
"59ae905f43d38f64d85d3c21"]
//array2 = [
"59bce938cbe9c90271742c1a",
"59bcebb4cbe9c90271742c2e" ]
and when i am adding them as arr.push(array1)
, arr.push(array2)
then i am getting this result
//arr = [ 59ae3b20a8473d45d11987f8,
59bb8a9c8f541e060054580e,
59ae905f43d38f64d85d3c21,
59bce938cbe9c90271742c1a,
59bcebb4cbe9c90271742c2e ]
in result array the type has changed(from strings) and i want these elements as string as they are in array1 and array2, i tried using concat but not working, please help