concat

Summary

Concatenates the specified element to the end of the array.

Signatures

Click on a signature to select it and view its documentation.

Usage

public T[] concat(T element)

Returns

A new array representing the original array with the concatenated element (via shallow copying).

Parameters

element

The element to concatenate.

Description

Concatenates the specified element to the end of the array.

Unlike System.Array<T>.push, this method does not mutate the array.

Examples

Basic Usage
1
2
3
4
5
import System;
 
int[] arr = [ 1, 2, 3 ];
Console.log(arr.concat(4)); // 1,2,3,4
Console.log(arr);           // 1,2,3

Share

HTML | BBCode | Direct Link