Phaser API Documentation

  Version: 
hasEither(object, key1, key2)

Description:

Check whether an object has at least one of the given properties.

Parameters:

name type description
object object

The object to check.

key1 string

The key of the first property to check the object for.

key2 string

The key of the second property to check the object for.

Returns:
Description:

true if at least one of the properties exists in the object, false if neither exist.

Type:
  • boolean
Since: 3.0.0