Last active
November 19, 2022 12:58
-
-
Save jswebschmiede/f2ccd2d5c12daafbe5aa804d44297ed2 to your computer and use it in GitHub Desktop.
Javascript Snippets Json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Arrow Function": { | |
"prefix": "arrow", | |
"body": ["const $1 = () => {", "$0", "}"], | |
"description": "Arrow Function" | |
}, | |
"Fetch": { | |
"prefix": "fetch", | |
"body": [ | |
"try {", | |
" const res = await fetch('$1');", | |
" const data = await res.json();", | |
"", | |
"} catch (err) {", | |
" console.error(err);", | |
"}" | |
], | |
"description": "Fetch" | |
}, | |
"Get Element by Id": { | |
"prefix": "getid", | |
"body": ["const $el = document.getElementById('$el');"], | |
"description": "Get Element by Id" | |
}, | |
"Add Event Listener": { | |
"prefix": "addevent", | |
"body": ["$1.addEventListener('$2', (e) => {", " $0", "});"], | |
"description": "Add Event Listener" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Snippet Generator https://snippet-generator.app/