← Previous Page - Next Page →

monster.util.dataFlags.get()#

Syntax#

monster.util.dataFlags.get(flagName, object);

Parameter#

flagName: String (mandatory)#

Name of the flag we want to get the value of.

object: Object (mandatory)#

Object in which the flag is set.

Return#

The value of the flag, so any JSON value is possible

Description#

This method looks into the flags and check if there's any matching the flagName provided. If yes it will return its value, if no, it will return undefined.

Examples#

var user = {
    first_name: 'JR',
    last_name: 'Maitre',
    markers: {
        monster: {
            source: 'smartpbx'
        }
    }
}

monster.util.dataFlags.get('source', user); //  => returns 'smartpbx';

Edit this page here