- Click on the extension tab
- Right click on a formatter (eg. Prettier)
- Disable (Workspace)
Othe method: https://dev.to/gulshansaini/how-to-disable-prettier-in-vscode-for-a-specific-project-2a48
Othe method: https://dev.to/gulshansaini/how-to-disable-prettier-in-vscode-for-a-specific-project-2a48
<nav class="nav">
<img
src="img/logo.png"
alt="Bankist logo"
class="nav__logo"
id="logo"
.push
(end).unshift
(start).pop
(end).shift
(start)let arr = ['a', 'b', 'c', 'd', 'e'];
// SLICE
console.log(arr.slice(2)); // ['c', 'd', 'e'], create a new aray starting at index index 2 and doesn't mutate the original array
console.log(arr.slice(2, 4)); // ['c', 'd'], start at index 2 and end at 4, 4 is exclusive
const runOnce = function () {
console.log('This will never run again');
};
runOnce();
// IIFE
const oneWord = function (str) {
return str.replace(/ /g, '').toLowerCase();
};
const upperFirstWord = function (str) {
const [first, ...others] = str.split(' ');
JS treats function as first class citizens.
This means that functions are simply values.
Functions are just another "type" of object.
JavaScript does not have pass by reference. The object passing might looks like passing by reference but it is still passing by value. The value here is the memory address in the stack that points to the object in the heap.
Again, JavaScript is a pure pass by value language. It's just that the values being passed around are references when not dealing with primitives
const flight = 'LH234';
const jonas = {
Why JS have Number(expression)
and new Number(expression)
?
Answer:
Boolean(expression)
will simply convert the expression into a boolean primitive value, while new Boolean(expression)
will create a wrapper object around the converted boolean value.
The difference can be seen with this: