Predefined Live Templates for JavaScript
This topic lists all predefined live templates for JavaScript in ReSharper 2024.3. For more information about live templates, refer to Create source code using live templates.
Template | Details |
---|---|
| Current file context Scope Everywhere Body $CTX$ Parameters
|
| Insert new GUID Scope Everywhere Body $GUID$ Parameters
|
| do...while loop Scope JS statements Body do {
$END$
} while($COND$) Parameters
|
| writeln function call Scope JS statements Body document.writeln($END$); Parameters
|
| else statement Scope JS statements Body else {
$END$
} Parameters
|
| for loop Scope JS statements (up to ES 5, not in TS) Body for (var $VAR$ = 0; $VAR$ < $LENGTH$; $VAR$++){
$END$
} Parameters
|
| for...in loop Scope JS statements (up to ES 5, not in TS) Body for (var $VAR$ in $ARRAY$){
$END$
} Parameters
|
| reverse for loop Scope JS statements (up to ES 5, not in TS) Body for (var $VAR$=$LENGTH$-1;$VAR$ >=0; $VAR$--){
$END$
} Parameters
|
| Create JavaScript function Scope JS expressions Body function($parameters$){
$END$
} Parameters
Before expansion After expansion |
| Scope JS statements Body function $name$($parameters$){
$END$
} Parameters
|
| if statement Scope JS statements Body if ($COND$){
$END$
} Parameters
|
| while loop Scope JS statements Body while ($COND$){
$END$
} Parameters
|
| with statement Scope JS statements Body with ($EXPR$){
$END$
} Parameters
|
| switch statement Scope JS statements Body switch ($EXPR$){
case $CASE1$:
$END$
default:
} Parameters
|
| try catch statement Scope JS statements Body try {
$END$
} catch (e) {
} Parameters
|
| Iterate an array Scope JS statements Body for (var $INDEX$=0;$INDEX$<$ARRAY$.length;$INDEX$++){
var $VAR$ = $ARRAY$[$INDEX$];$END$
} Parameters
Before expansion After expansion |
| generator Scope JS statements (ES 6, not in TS) Body function *$name$($parameters$){
$END$
} Parameters
|
| for-of loop Scope JS statements (ES 6) Body for ($VARKIND$ $VAR$ of $ARRAY$){
$END$
} Parameters
|