Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 566 Bytes

File metadata and controls

27 lines (21 loc) · 566 Bytes

KeyboardEvent.code vs keydown
-Represents a physical key on a keyboard vs the UTF-8 generated

KeyboardEvent.code vs

useEffect(() => {
    document.addEventListener("keydown", handleKeyboard)

return () => {
     document.removeEventListener("keydown", handleKeybaord)
}
 }, [handleKeyboard])

Looping Backwards is faster Only by a margin

New Date

{new Date(props.prop).toLocaleTimeString({hour: "numeric", minute: "numeric"})}

Set Interval

setInterval(() => {setState(prev => prev), 1000})