I thought you were testing if the variable extractor exists and you were using that condition inside your loop. But if i understand correctly you are checking the content of your variable extractor and not the fact that it exists or not correct?
If it's really the content, you can override the value using a Javascript. You can use the setValue method with the same name of your extractor and assign any values.
Something like context.variableManager.setValue("MyExtractor","foo"); where MyExtractor is the name of your variable extractor.