queue shift javascript code example
Example 1: remove first element from array javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.shift();
Example 2: array shift javascript
const array1 = [1, 2, 3];
const firstElement = array1.shift();
console.log(array1);
console.log(firstElement);
Example 3: javascript move array element to front
for(var i = 0; i<$scope.notes.length;i++){
if($scope.notes[i].is_important){
var imortant_note = $scope.notes.splice(i,1);
$scope.notes.unshift(imortant_note[0]);
}
}