monster.util.dataFlags.destroy()

Syntax

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

Parameter

flagName: String (mandatory)

Name of the flag we want to delete from the object.

object: Object (mandatory)

Object where you want to delete the flag from

Return

The updated object (to allow for chaining, as the object itself is already updated by reference)

Description

The method deletes the property flagName from the object and return the updated object.

Examples

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

monster.util.dataFlags.delete('source', user); //  => returns 'smartpbx';
/*
{
    first_name: 'JR',
    last_name: 'Maitre',
    markers: {
        monster: {}
    }
}
*/

Edit this page here