Skip to content

columns

SuperPhantomUser edited this page Jun 10, 2021 · 1 revision

Columns

The columns method returns the number of columns

Array types: 2d+
Returns: integer

Arguments:

  • array
  • type (optional)

Examples:

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

Clone this wiki locally