object_setDefault

If object does not have key, add it.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/427473/937466/object_setDefault.js

Autor
Bogudan
Verzija
0.5
Napravljeno
03/06/2021
Ažurirano
03/06/2021
Size
500 бајтова
Licenca
LGPLv3

Added method setDefault to object prototype.

function setDefault (key, value)

If object does not have key, add it with value value

key (string, required)
    key to check
value (any, optional, default = undefined)
    value for key if it's not present