- TypeScript Tutorial
- TypeScript - Home
- TypeScript - Overview
- TypeScript - Environment Setup
- TypeScript - Basic Syntax
- TypeScript - Types
- TypeScript - Variables
- TypeScript - Operators
- TypeScript - Decision Making
- TypeScript - Loops
- TypeScript - Functions
- TypeScript - Numbers
- TypeScript - Strings
- TypeScript - Arrays
- TypeScript - Tuples
- TypeScript - Union
- TypeScript - Interfaces
- TypeScript - Classes
- TypeScript - Objects
- TypeScript - Namespaces
- TypeScript - Modules
- TypeScript - Ambients
- TypeScript Useful Resources
- TypeScript - Quick Guide
- TypeScript - Useful Resources
- TypeScript - Discussion
TypeScript - Array concat()
concat() method returns a new array comprised of this array joined with two or more arrays.
Syntax
array.concat(value1, value2, ..., valueN);
Parameter Details
valueN − Arrays and/or values to concatenate to the resulting array.
Return Value
Returns a new array.
Example
var alpha = ["a", "b", "c"]; var numeric = [1, 2, 3]; var alphaNumeric = alpha.concat(numeric); console.log("alphaNumeric : " + alphaNumeric );
On compiling, it will generate the same code in JavaScript.
Its output is as follows −
alphaNumeric : a,b,c,1,2,3
typescript_arrays.htm
Advertisements