Skip to content
SuperPhantomUser edited this page Jun 10, 2021 · 1 revision

Column

The column method returns an array - the column specified

Array types: 2d+
Returns: array

Arguments:

  • array
  • index

Examples:

const array = [
	["a", "b", "c", "d"],
	["e", "f", "g", "h"]
];
console.log(Arrays.column(array, 1));
// Returns: ["b", "f"]
const array = [
	[
		["a", "b", "c", "d"],
		["e", "f", "g", "h"]
	],
	[
		["i", "j", "k", "l"],
		["m", "n", "o", "p"]
	]
];
console.log(Arrays.column(array, 1));
// Returns: [["e", "f", "g", "h"], ["m", "n", "o", "p"]]

Clone this wiki locally