user494461
user494461

Reputation:

how to insert and if defined for a variable in webstorm

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;
}

Upvotes: 0

Views: 39

Answers (1)

lena
lena

Reputation: 93728

You can try using live templates for this - see surround live templates.

Upvotes: 2

Related Questions