duplicate values in foreach javascript code example
Example: function that duplicates data in array js
function doubleValues(array) {
var newArray = [];
array.forEach(function (el) { newArray.push(el, el); });
return newArray;
}
console.log(doubleValues([1,2,3]));