difference between key and code in javascript
// Key -> if you care about the character which was typed
// Code -> if you care about the key which was pressed on the keyboard because your can change the language on your pc.
const input = document.querySelector("input");
input.addEventListener("keydown", function (e) {
console.log(e.key);
console.log(e.code);
});
Also in JavaScript:
- javascript for eac loop
- how to allow implicit any in .d.ts
- javascript detect browser type
- js get last array element
- click listener on by class name in javascript
- react native passing params to nested navigators
- creating a table in js
- spreadjs autofit column with minimum
- denuncia perturbação
- Returning Boolean Values from Functions
- express request path
- swap variables using temp javascript
- try catch with for loop in javascript
- javascript show stack trace
- js append to array
- javascript array merge
- return statement javascript
- return value from javascript function
- convert timestamp to date js
- javascript list class properties
- straforma in stringa js
- the simulation using expo won't start - react native
- objeto con método javascript
- react hide source code