Skip to content

Instantly share code, notes, and snippets.

@gotjoshua
Created August 8, 2022 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gotjoshua/ddb7645e559814fc84d6712223ca7d51 to your computer and use it in GitHub Desktop.
Save gotjoshua/ddb7645e559814fc84d6712223ca7d51 to your computer and use it in GitHub Desktop.
convert for of loop topline to use index
"convert for of loop topline to use index" : {
"prefix": "fc",
"body": ["${TM_SELECTED_TEXT/(for \\(const )(.*) of (.*)\\) {/$1[idx, $2] of $3.entries()) {/}"],
"description": "to use this snippet, select the top line of your for loop, type fc on top of it, choose snippet"
},
@gotjoshua
Copy link
Author

reg ex for testing regexr.com/6re4q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment