Expand my Community achievements bar.

SOLVED

How to clear profile script local variable

Avatar

Level 3

Hello.
I have a profile script where I create a local variable using 
user.setLocal('name', 'value');
Is it possible to remove this varialbe as if it was never created before instead of using this approach ?:
user.setLocal('name', undefined);

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@kirill_techZone AFAIK it isn't possible to remove/delete it. The alternative is as @Gokul_Agiwal is to set it with an empty string or set a 'null' value.

View solution in original post

2 Replies

Avatar

Community Advisor

HI @kirill_techZone 

Could you elaborate more on the scenario why you want to remove this variable? 

Have you tried with empty string like user.setLocal('name', ' ');

Avatar

Correct answer by
Community Advisor

@kirill_techZone AFAIK it isn't possible to remove/delete it. The alternative is as @Gokul_Agiwal is to set it with an empty string or set a 'null' value.