object_setDefault

If object does not have key, add it.

Versão de: 03/06/2021. Veja: a última versão.

Este script não deve ser instalado diretamente. Este script é uma biblioteca de outros scripts para incluir com o diretório meta // @require https://update.greatest.deepsurf.us/scripts/427473/937462/object_setDefault.js

Autor
Bogudan
Versão
0.4
Criado
03/06/2021
Atualizado
03/06/2021
Tamanho
396 Bytes
Licença
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