Filed under:
Well, console.log is already short enough. In VS Code, you can simply type log to expand it into console.log.
Can we make it even faster, though? Sure, by typing asd. Here's the VS Code snippet:
{
"Print to console": {
"prefix": "asd",
"body": [
"console.log($1)",
],
"description": "Log output to console"
}
}I removed the extra newline, the quotes, and the semicolon. Typically, we log a variable rather than a string, and we naturally hit a new line before logging. As for the semicolon, it just feels neater with fewer characters on the screen, I guess.
Now, you can trigger the console.log snippet without moving your hand much—assuming your hand is naturally placed on ASD, the typical gaming finger position.