21 LIFE CHANGING JavaScript tricks

preview_player
Показать описание


#coding #programming #javascript ❗Free Programming Cheat Sheets (JavaScript, Python, React, CSS)

❗Learn How to Earn a Side Income with Freelance Coding
Рекомендации по теме
Комментарии
Автор

Man your JS Cheat Sheet is the most gorgeous thing I've seen in a while, so compact, concise and good looking OMG Loved It! <3

jaimerojas
Автор

my favorite life changing JavaScript tip:

yarn add -D typescript

bawad
Автор

1:00 - Local Storage
2:08 - Session Storage
2:30 - document.cookie
3:10 - Console Methods
3:29 - Log Colors

5:38 - Destructive Args

I_am_Alan
Автор

Deep cloning issuse can be fix using json Parsing and stringify

soorajkj
Автор

When i have to make a deep copy of an object i use: JSON.parse(JSON.stringify( object )) ... that is if i dont need to import a lib like lowdash

MinNyeAccount
Автор

One file if statements
Vs code prettier: Let's make that multiline!

migueldomingos
Автор

Using lodash for every small problem could result in a huge bundle sizes. Especially when imported as you shown as a destructured object. This would be much preferred way if you are adamant in using lodash eagerly:

import map from "lodash/map";

this way, you only import what you really need, and not the whole library.

Still cool video though, learned couple of neat tricks :)

dusannikcevic
Автор

Double ternary is easier to read when you wrap the second condition in parenthesis imo

DanielTateNZ
Автор

at 8:11 how are you showing those console.log within editor? Is it a vscode extension or you added in while editing video. Thanks.

ahsansher
Автор

You can use optional chaining in JS instead of the get function from lodash. To use it you do: just use the ? before the dot notation to check if it's null

mudandmoss
Автор

Yes yes yes yessss!!! I am super excited you are finally making a web scraping course. Even better hat it’s with js

Alex-xwbc
Автор

Yes yes yes!
I was so freaking waiting to learn web scraping for long time, I'll be waiting eagerly to buy your course!!!! Thanks Aaron, you're the best!

AS-ifjg
Автор

Love these types of videos! I hope that you will also intermix some news item videos every now and then too!

cranklepuss
Автор

18:35 - That was the best part imo. The Dark Arts! Absolutely agree with you that those simple If statements cramming up 5-6 lines is sacrilege... that ternary trick is BEAUTIFUL. Next time please keep the dark arts right at the beginning! ;D

EnglishRain
Автор

Great video, I work with JS everyday and its impossible to know/remember all these tricks. Keep up the videos like this!

mxc_clips
Автор

12:40

You can also add question mark at the end of each attributes, should work just fine too with the recent update of node ! (user?.profile?.fullName)

veeker
Автор

If you want to adopt latest features of native javascript, you can use optional changing instead of lodash get
const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah'
}
};

const dogName = adventurer.dog?.name;

can also use nullish coalescing operator (??) for defaults

this prevents unexpected behaviors if you consider some falsy values as usable (eg. '' or 0).

there is also Logical nullish assignment (??=) which only assigns if x is nullish (null or undefined).

const a = { duration: 50 };

a.duration ??= 10;
console.log(a.duration);
// expected output: 50

tylerjnewman
Автор

i love writing nested ternary operations specially calling methods or even anonymous arrow functions. can you please make another video like this going deeper? thanks

david-cnxv
Автор

I'm only new to coding and the last tip blew my mind

engboy
Автор

What VS Code theme and font do you use?

ngx