ReSharper Web Help

ReSharper | Live Templates | Live Templates | Predefined Templates | JavaScript

JavaScript

ReSharper provides several live templates for JavaScript, which are described below.

Template name Description
itar

Go to top

Purpose
Creates aforloop.

for (var $INDEX$ = 0; $INDEX$ < $ARRAY$.length; $INDEX$++) {
    var $VAR$ = $ARRAY$[$INDEX$];
    $END$
}

Before expansion

After expansion

Parameters

  • INDEX- name of index variable.
  • ARRAY- array to iterate over.
  • VAR- name of variable to hold the current array element.

itin

Go to top

Purpose
Creates aforloop.

for (var $VARIABLE$ in $COLLECTION$) {
  $END$
}

Before expansion

After expansion

Parameters

  • VARIABLE- name of index variable.
  • COLLECTION- array to iterate over.

ritar

Go to top

Purpose
Generates aforloop for iterating over an array in reverse order. Includes a customizable statement in the loop body with a variable holding container elements.

for (var $INDEX$ = $ARRAY$.length - 1; $INDEX$ >= 0; $INDEX$--) {
  var $VAR$ = $ARRAY$[$INDEX$];
  $END$
}

Before expansion

After expansion

Parameters

  • INDEX- iterator variable.
  • ARRAY- array instance to iterate over.
  • VAR- variable to hold the current array element.

See Also

Reference