Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Returns a list of all currently defined labels...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
var list = enumLabels();

Parameters

The function has no parameters.

Return value

ValueTypeDescriptionGame version
<list>Array of String

A list of label names currently registered with the JS API.

Use label() to get the object associated with a label.

3.2
[]Empty ArrayIf there are no labels yet, an empty array is returned.3.2

Example

Code Block
themeRDark
languagejavascript
titleIterate all labels, getting the objects associated with them...
linenumberstrue
enumLabelenumLabels().forEach( function getObjectFor(labelName) {
	var obj = label(labelName); // retrieve object
	if (obj) {
		// do stuff with object
	} else {
		// there are no objects associated with this label
	}
} );
Div
classbox
Availability
Status
colourYellow
title3.2+

Requires:

  • Warzone 3.2 and above.
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Include Page
.jslinks-labels
.jslinks-labels