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 - |
题
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;
}
解决方案
不隶属于 StackOverflow