TypeScript Array unshift() - TypeScript

What is TypeScript - Array unshift()?

unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.

Syntax

Parameter Details

Return Value

Returns the length of the new array. It returns undefined in IE browser.

Example

On compiling, it will generate the same code in JavaScript.

Its output is as follows −

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

TypeScript Topics