JavaScript добавьте в неопределенную
test = undefined;
test = (+test || 0) + 1;
DevinRC
test = undefined;
test = (+test || 0) + 1;