push or concat code example
Example 1: javascript push and concat
//push() adds element in the end of array
// concat() also the same, but if the element is array, that element will probably separate elements of itself in the end of the array
Example 2: concat push
var arr = [1, 2, 3, 4];
var filtered = arr.filter(function(element, index, array) {
return (index % 2 === 0);
});