Björn Fällbom <zcorpio@gmail.com>
A collection of the keyboard shotcuts and snippets I find myself searching for most often.
Björn Fällbom <zcorpio@gmail.com>
A collection of the keyboard shotcuts and snippets I find myself searching for most often.
if (a > b && a > c) | |
large = a; | |
else if (b > a && b > c) | |
large = b; | |
else | |
large = c; |
A collection of the keyboard shotcuts and snippets I find myself searching for most often.
Shortcut | Action |
---|---|
CTRL + SHIFT + SPACE |
Open IntelliSense (Then, ARROW KEY to cycle through) |
F1 |
Display .NET Docs for highligted identifier i.e a variable, built in class etc. |
F2 |
Rename all instances of an identifier i.e a variable, class or function |
SHIFT + F11 |
Step Out |
A global object is part of the global scope. This mean we can access it from anywhere, any file, in our "program". line break Examples of global objects in JavaScript are: console.log(), setTimeout(), clearTimeout(), setInterval(), clearInterval().
In browsers the global scope is represented by the window object. This means all variables and functions that exist in the global scope can be accessed via this object. For example window.console.log(). However you would normaly access it by the short hand us of just console.log().
import {useState} from "react"
function useToggler(defaultOnValue = false) {
const [isToggledOn, setIsToggledOn] = useState(defaultOnValue)
function toggle() {
setIsToggledOn(prev => !prev)
}