Versions Compared

Key

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

Get the label, if any, associated with a game object...

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
var labelName = getLabel(object);

Parameters

ParameterTypeMandatoryNotesWarzone VersionGame version
object

Game object

(tick)

The object to inspect.

3.2

Return value

ValueTypeNotesWarzone VersionGame version
<labelName>String

If the object has a label, the name of the label will be returned.

If an object has multiple labels, only the first label found will be returned.

3.2
nullNullThe object is not labelled.3.2
<error>ErrorAn error occurred, most likely invalid parameters.3.2

Notes

Be careful not to name call a variable "label" as that's also the name of a global function: label()

Example

Code Block
themeRDark
languagejavascript
linenumberstrue
var theLabel = getLabel(someObject);
Div
classnotice box ping

This is a relatively slow operation of O(n) algorithmic complexity.

Div
classbox
Availability
Status
colourYellow
title3.2+

Requires:

  • Warzone 3.2 or above
Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Include Page
.jslinks-labels
.jslinks-labels