You can try using live templates for this - see surround live templates.
how to insert and if defined for a variable in webstorm
-
08-07-2023 - |
Question
suppose I have a code
var val = event.deltaX;
how can I auto insert a code which will transform the above into
if(event.deltaX)
{
x = event.deltaX;
}
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow