The easiest way is using shift()
. If you have an array, the shift
function shifts everything to the left.
var arr = [1, 2, 3, 4];
var theRemovedElement = arr.shift(); // theRemovedElement == 1
console.log(arr); // [2, 3, 4]
More Related Contents:
- authentification with angular js
- Working with $scope.$emit and $scope.$on
- Can one AngularJS controller call another?
- AngularJS with Django – Conflicting template tags
- Loading an AngularJS controller dynamically
- Generate PDF from HTML using pdfMake in Angularjs
- Ternary operator in AngularJS templates
- Injecting a mock into an AngularJS service
- How to reduce javascript object to only contain properties from interface
- How to do two-way filtering in AngularJS?
- How to make a directive update ng-model on jquery on event?
- Angular UI-Router $urlRouterProvider .when not working when I click
- AngularJS routing 404 error with HTML5 mode
- Set active tab style with AngularJS
- How do I mock a service that returns promise in AngularJS Jasmine unit test?
- using setInterval in angularjs factory
- How to set default browser window size in Protractor/WebdriverJS
- Sort an object array by custom order
- How to use parameters within the filter in AngularJS?
- Showing alert in angularjs when user leaves a page
- How to pass parameters to a modal?
- TypeError: Cannot read property ‘then’ of undefined
- Dynamic form name attribute in Angularjs
- How can I access a variable outside a promise `.then` method?
- random orderBy in AngularJS 1.2 returns ‘infdig’ errors
- Limiting number of displayed results when using ngRepeat
- AngularJS – placeholder for empty result from filter
- Dynamically assign ng-model
- Accessing Angular inside Protractor Test
- AngularJS and WebSockets beyond