object_setDefault

If object does not have key, add it.

Acest script nu ar trebui instalat direct. Aceasta este o bibliotecă pentru alte scripturi care este inclusă prin directiva meta a // @require https://update.greasyfork.org/scripts/427473/937466/object_setDefault.js

Autor
Bogudan
Versiune
0.5
Creat
03-06-2021
Actualizat
03-06-2021
Licență
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