Working with context in function nodes

While working/writing code in some function nodes, it just came to my mind that I'm missing a method/function

I have some code that is used in a simulator that runs several iterations and I would like it to start "clean" every cycle, i.e. with no context variables yet created when a new cycle starts

The value of a variable that is created with, as example, context.set('age', 25); can easily be changed but how to delete it? From the menu "Context Data" it is easy but how to from code in a function node. I would like to see a method like context.del('age');

The same goes for flow & global

Have I missed some other way of deleting variables in context from code in a function node?

Try context.set("age",undefined)

1 Like

Dear Bakman, thank you very much! It works fine as you proposed!!!

Maybe not that obvious,,,having a del method is maybe more user friendly, for future NR releases???

Then i would opt for context.unset("age") instead.

3 Likes

Even better :wink:

1 Like