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.21 Beta 3
[]Empty ArrayIf there are no labels yet, an empty array is returned.3.21 Beta 3

Example

Code Block
themeRDark
languagejavascript
titleIterate all labels, getting the objects associated with them...
linenumberstrue
enumLabels().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
colour
Yellow
Green
title3.
2
1 b3+

Requires:

  • Warzone 3.2 1 Beta 3 and above.
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Include Page
.jslinks-labels
.jslinks-labels