Skip to content

Instantly share code, notes, and snippets.

View greemwahr's full-sized avatar
🎯
Focusing

Greemwahr greemwahr

🎯
Focusing
  • Anonymous
View GitHub Profile
function move_zeros(arrNum, isRight){
isRight = typeof isRight === 'undefined' ? true : isRight;
// console.log(arrNum);
// console.log(isRight);
var arrNumLength = arrNum.length;
function eliminateZeros(element) {
return element !== 0;
}
function duplicates(arr) {
var mergedArray = [].concat.apply([], arr);
console.log(mergedArray);
var arrSorted = mergedArray.sort(function (a, b) {
return a - b;
});
console.log(arrSorted);