I would like to reorganize the variable inside the function, but only inside this function. Is this possible in a JetBrains environment?
Example:
var global = 0; function func1 (val) { if (val === global) { doSomething(); } else if (val * 2 === global) { doSomethingElse(); } else { doSomethingElseEntirely(); } } function func2 (val) { if (val === global) { doSomething(); } else if (val * 2 === global) { doSomethingElse(); } else { doSomethingElseEntirely(); } }
If I try to change the global variable inside func1 through refactoring, it will be changed in the entire scope of global regions, therefore in func2 . I would like to prevent this. Is it possible?
source share