Top 5 Javascript Things You Should Know!

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 402

  • @sayantoroy8790
    @sayantoroy8790 5 років тому +139

    8:33 - Yea Boy!! That's the most amazing part of the whole video. BTW loved it. The video.

    • @starkxz
      @starkxz 5 років тому +4

      lol I was thinking that I'm the only one that likes it, don't forget the BOOOM SFX though

    • @ytb.addict
      @ytb.addict 5 років тому +3

      Find awesome tutorials for JS, AngularJS, NodeJS, ReactJS
      freelectureslinks.blogspot.com

    • @SH-lt2iv
      @SH-lt2iv 5 років тому +1

      lmao just got on that part was gonna comment but already seen here haha

    • @salemouail627
      @salemouail627 4 роки тому +1

      1 BOOOM !

    • @bragiodinsen4604
      @bragiodinsen4604 3 роки тому

      No, you loved that beautiful face.

  • @bokibogi
    @bokibogi 4 роки тому +279

    Para salto rápido:
    00:40 Hoisting
    06:50 Callstack
    11:16 IIFE
    13:03 Scope
    17:28 Callbacks
    25:06 Async await

  • @reachammad
    @reachammad 5 років тому +10

    Never have I watched someone explain callbacks, promises, async and await so clearly! Keep it up

  • @Jinado1
    @Jinado1 4 роки тому +27

    Hey, Ed! I really enjoyed your video, however I would like to add something when it comes to scope.
    There's a difference between creating a variable using the keyword "var" and using the keywords "let/const". Bascially, a variable created with "var" has a standard scope of "Function scope" (if it is not declared globally, of course). That means that no matter where you declare that variable in a function, it will be accessible by that function anywhere after its declaration, while "let" and "const" have a "Block scope" which means it's only accessible within the block in which it was declared, and any children of that block. A block would be anything like a Switch-statement or an IF-statement for example.
    If you look at the below code, you'll see that inside the function *sayHello()* , there is an IF-statement, and within that IF-statement is a variable declaration (and assignment) using the "let" keyword.
    *function sayHello(){*
    *if(true){*
    *let name = "Pedro";*
    *console.log("Hello there, " + name + "!");*
    *}*
    *}*
    *sayHello();*
    When running the above code, you'll get the following output:
    *Hello there, Pedro!*
    If you were to then add a second console.log() call after the IF-statement, but still inside the function, like below:
    *function sayHello(){*
    *if(true){*
    *let name = "Pedro";*
    *console.log("Hello there, " + name + "!");*
    *}*
    *console.log("Is that really you, " + name + "?");*
    *}*
    *sayHello();*
    You will end up getting an error because "name" is undefined. The reason for that being that the variable "name", due to being declared with the "let" keyword, has a block scope. Which, again, means only the block (in this case, the IF-statement), or any child blocks (for example, another IF-statement INSIDE the first IF-statement) has access to the variable. BUT, if it were to be declared using the "var" keyword instead, it would recieve function scope, meaning it would be accessible not only within the block it was declared, but within the whole function in which it was declared. So the following code would NOT throw an error.
    *function sayHello(){*
    *if(true){*
    *var name = "Pedro";*
    *console.log("Hello there, " + name + "!");*
    *}*
    *console.log("Is that really you, " + name + "?");*
    *}*
    *sayHello();*
    Instead, it would give you the following output:
    *Hello there, Pedro!*
    *Is that really you, Pedro?*

    • @satishreddy1284
      @satishreddy1284 3 роки тому

      You explanation is really good thank you from india

    • @rishabhgupta8876
      @rishabhgupta8876 3 роки тому

      great explanation, brother. Thanks!

    • @marcopolocs
      @marcopolocs 2 роки тому

      This is really going deep but if you are at it you should explain closures then since these things are closely related. I myself am lost a little how to understand closures, how it works within the memory.

  • @neilpearce
    @neilpearce 5 років тому +276

    Sorry, but you haven't really explained how 'Hoisting' works. The JS engine doesn't actually put anything at the top of your page. Here's what really happens....
    When your code is run it goes through what is called the 'execution context' and there's two phases to this...
    1. The Creation phase..
    2. The Execution phase.
    During the creation phase your code is scanned for all functions and variable declarations and all what is found is placed within memory (or what is called the 'variable environment’') Then when the JS engine goes through the next phase (execution) all your variables and function declarations are available to use. This is what's called 'Hoisting'.
    However, they are hoisted in a different way and it's important to remember this....
    Functions are already defined BEFORE the execution phase started, but your variables are set to 'undefined' and will only be defined during the execution phase.
    Sorry to sound like I'm putting you down, but it grips my shit when developers don 't explain truly how hoisting works, so I hope that helps 😃

    • @kornelnyp
      @kornelnyp 5 років тому +11

      Great explanation mate. I was thinking the same thing.

    • @igeoerre
      @igeoerre 5 років тому +45

      I believe Ed gave a simplified version without technical details for us to understand the concept. Sometimes it can confuse people who just want to know how it works without delving into the subject. However I like to know the details, thank you very much for your explanation.

    • @hip04hop85
      @hip04hop85 5 років тому +1

      This!

    • @siyaram2855
      @siyaram2855 5 років тому +6

      Anthony alicea 😎

    • @SumitKumar-co2pm
      @SumitKumar-co2pm 5 років тому +5

      All hail Sir Anthony Alicea 👏👏

  • @yt.mhasan
    @yt.mhasan 5 років тому +21

    Now I have to press bell icon. I've been following your uploads and watching, but now I have to have alert for your uploads. You're creating awesome and quality contents for us, for the community, for the present.
    Thank you, man.

  • @wafaken
    @wafaken 4 роки тому

    I was about to close this video thinking you will just talk about what to learn for half an hour but I stick to it a bit longer and I got surprise that you teach the things you talk about. And I thank myself for sticking to it. I got a good grasp of things you teach here. Thank you.

  • @sammaxudov1246
    @sammaxudov1246 4 роки тому +62

    He sneezes in 2019: God Bless you.
    He sneezes these days: I'm outta here

  • @robertto1ify
    @robertto1ify 4 роки тому

    Im so happy to "find" you here man. English is not my native language, and Im not the "smartest" person about computer programming, but you explain very very very well!! Congratulations and all my respect!

  • @davidguetta9874
    @davidguetta9874 5 років тому +126

    Top 6 - In job interview never forget to tell that P in HTML stands for Programming

    • @ajbwbd
      @ajbwbd 5 років тому +6

      There isn't even any 'P' in HTML 😂😂.... (BEST INDIRECT ROAST TO PEOPLE NOT NOTICING THAT)

    • @evakuator8118
      @evakuator8118 5 років тому +35

      @@ajbwbd best way to ruin a joke is to explain it :\

    • @medoubella
      @medoubella 5 років тому +9

      @youtubesucks I'm not the only one who immediately thought about the p tag 😂

    • @Microphunktv-jb3kj
      @Microphunktv-jb3kj 5 років тому +1

      well html is pee... that's why some people have switched to Pug or others... ^^

    • @yusakmanullang7656
      @yusakmanullang7656 4 роки тому +4

      I'm HTML engineer, I'll sue you

  • @runningthenorth-west516
    @runningthenorth-west516 4 роки тому +1

    I've watched a lot of JS beginner videos, and Dev Ed's have always been the most entertaining/interesting. Keep it up!

  • @Rambou92
    @Rambou92 5 років тому

    Actually, @Dev Ed at 2:10 the javascript compiler will not "move" any code, it will add them to Javascripts lexical environment data structure. Awesome video by the way!

  • @nith.p
    @nith.p 5 років тому +7

    Top 3 hardest thing in JavaScript:
    1. Promise
    2. Prototypes
    3. Advanced Syntaxes

    • @kresimircosic3753
      @kresimircosic3753 5 років тому +2

      Funny thing is, I am already pretty familiar with all these, but seeing people writing insane packages or libraries using cutting edge code puts me in a weird position. Especially since they are utilizing TypeScript as a norm, and they write it in a pretty complicated way.

    • @nith.p
      @nith.p 5 років тому +4

      @@kresimircosic3753 that's what comes to my mind when I try to build my own version of those crazy packages. When I look into all those codes I was like: Did your mother teach you to code like this? I think I'll back off this project.

  • @CleeveMorris
    @CleeveMorris 2 роки тому

    you're the best doing these tutorials. believe me. it always a fun time learning, thanks!

  • @pushpakgupta7396
    @pushpakgupta7396 5 років тому +14

    i just can't control my smile when you come smiling onto the screen :)

  • @AndrewGray-natreve
    @AndrewGray-natreve 5 років тому +7

    Good video, I knew this already. But enjoyed your CSS and html videos so wanted to support the JavaScript videos too!

  • @suchitbande5074
    @suchitbande5074 5 років тому +2

    Hey Ed, Thank you for making videos like these and explaining complex concepts in simplest way. Can you please make a video series on NodeJs explaining each concept in details. That would be really helpful. Thank you :).

  • @aleksd286
    @aleksd286 5 років тому

    Thanks for event loop, callback queue and web apis. I am a junior full stack developer and that is pretty helpful to know, before I knew how it worked, now I know why

  • @RyanJohnson
    @RyanJohnson 3 роки тому

    👍 for switching gears for that call stack explanation.

  • @wirklichtotal8996
    @wirklichtotal8996 5 років тому

    Franky, this is the most relevant js course ever. Thank you Mr for your approach. This is really professional

  • @busyrand
    @busyrand 5 років тому +2

    This was a phenomenal explanation of concepts that I was aware of, but couldn't grasp well enough to explain them. Well done. Thank you.

  • @stevenherra4975
    @stevenherra4975 4 роки тому

    Just keep them comming!!! This may be my favorite coding channel among all, great work!

  • @ralphlouis2705
    @ralphlouis2705 4 роки тому

    At the beginning I already knew ur explanation will clear the air ways

  • @abdalwahab7370
    @abdalwahab7370 5 років тому +1

    One of the best channels on UA-cam

  • @silvoaxhacka5506
    @silvoaxhacka5506 5 років тому

    Greetings from France !
    You actually are one of the best coding youtuber, with a real personnality :)
    We are never bored! Even your little mistakes makes the video more "fun" and lively!
    (Btw, I'm sorry for my english)

  • @devdude7607
    @devdude7607 3 роки тому

    Thank you so much dude!U r one of my first inspiration to keep up with web dev carrier,when i knew shit about programming.Thank you so much my man!

  • @nikolaykoychev8261
    @nikolaykoychev8261 4 роки тому +1

    Best video on the internet about JS!!!

  • @pichdarapo3145
    @pichdarapo3145 5 років тому +1

    My best teacher on UA-cam!!!!

  • @shahbozabdullayev5583
    @shahbozabdullayev5583 4 роки тому

    The hardest things were Node interface, Element interface and actually their differences, those were so tricky and confusing that I usually got stuck. It would be best of you to explain me their differences from each other. Thank you!

  • @romanroman9638
    @romanroman9638 4 роки тому

    for me - the hardest part of JS is - callbacks and promises. Thank you for mentioning that up

  • @kornelnyp
    @kornelnyp 5 років тому

    Hey! Just a note. Correct me if I'm wrong but as far as I know there are 3 scopes. Global, function and also block scope which you forgot to mention. An example of a block scope is a block o code following the if() statement. I thought learners should be aware of that too. Cheers

    • @TheMessixaviniesta
      @TheMessixaviniesta 5 років тому

      ES6 did introduce block scope, but only for let and const.

  • @sudharshaniyengar1587
    @sudharshaniyengar1587 5 років тому +8

    Keep doing such awesome vids!!! Love from India !!!

  • @cyberprompt
    @cyberprompt 5 років тому

    strange you typed the "correct" way to do an IIFE, then it changed to what Doug Crockford calls "dog balls notation". Both work, but I'd be confused if this was my first time seeing it.
    in case you are reading this and are confused:
    (function(){
    ...
    }());

  • @rahulrana892
    @rahulrana892 4 роки тому

    This is pure gold in knowledge

  • @mouhamaddiop1144
    @mouhamaddiop1144 5 років тому

    You're absolutely cool. Your sneeze is just perfect.

  • @abhishektyagi4428
    @abhishektyagi4428 5 років тому +2

    Sir Could you please make a video explaining the resources you use to learn or enhance your programming skills

  • @aliprokanggames4458
    @aliprokanggames4458 5 років тому +6

    Great Video as always!
    But could you do some videos on algorithms and data structures (hash maps, stacks, binary trees etc.)? That would be awesome

  • @wilbertopachecobatista5049
    @wilbertopachecobatista5049 5 років тому

    Man this has been the best explanation about CallStack ever. Thanks!!!

  • @FirstLast-gk6lg
    @FirstLast-gk6lg 3 роки тому

    I would love to see a video on "Things a JS developer without a CS degree doesn't know" because that is me :)
    I am 10-11 months into coding, 3000ish hours, working in my first Web Dev job. And I have this suspicion that bc I don't know computer science i am missing a lot of info under the hood. Would love to see info on that topic. Thank you

  • @RameenFallschirmjager
    @RameenFallschirmjager 5 років тому +1

    understanding is very pleasant feeling!

  • @MexicanFamilyinPEI
    @MexicanFamilyinPEI 4 роки тому +1

    Amazing Ed, always learning something new with your videos, thanks!

  • @thewildsisters4596
    @thewildsisters4596 3 роки тому +1

    But if I'm right hoisting isn't actually moving our code to to top if that was the case than your code would of ran with out an undefined value which to correct you is not an error it's actually a value a special value created for us when it's ran through the execution context and this just means lack of existence. The reason your able call the name after using a const is because the variable is already saved in memory and this is what hoisting is. Hoisting is not taking your code and running it as if it was at the top. Hoisting is when the execution context is created during this phase memory space is set up for variables and functions that is called hoisting 😎😎

  • @emmytobs
    @emmytobs 5 років тому +2

    Hey man. Really appreciate your taking out the time to upload this videos. I'll like to know how you were able to run the console in your VScode. It looks really handy and definitely seems like something I really need. Thanks

    • @okmorenumbers
      @okmorenumbers 4 роки тому +1

      so, use the terminal to navigate to the folder containing your js file. Then type "node filename" and it will run. ["directory" node app.js]

    • @timepassscript
      @timepassscript 2 роки тому

      Or instead just download the extension for run code.
      Then you will basically get a button at the top right portion of editor. Or you can click ctrl+alt+n

  • @whatsappboy6980
    @whatsappboy6980 5 років тому +4

    This is what I wanted ! Keep it Up Ed

  • @GeordyJames
    @GeordyJames 5 років тому +1

    Hoisting is not moving up variables and functions to the top. It is the process of setting up of memory space during the creation phase. The variables will be assigned undefined and the whole functions will be stored into the memory. This is also a reason in which anonymous function cannot be hoisted as its initial value will be assigned undefined and you cannot call a undefined.

  • @rajanbrahma0
    @rajanbrahma0 5 років тому +2

    Explained in the simplest way!! Great job!

  • @jlambert12013
    @jlambert12013 2 роки тому

    Never seen any of this explained so well, thanks!!

  • @naiki1409
    @naiki1409 5 років тому +3

    Bell clicked,nice video. Can you also explain lexical scope?

  • @olatunjisamson3918
    @olatunjisamson3918 3 роки тому

    new to your channel. the session i watched was so interesting, i subscribed immediately. i just want to know how you've set up your vscode.

  • @agent000000008
    @agent000000008 5 років тому +8

    *Hey nice video, thanks a lot!*
    But did you accidentally cut the part before the async/await? Was there something about promises? Video felt like it was cut off after the event loop to the async. you are even saying that you were doing something before... but it’s not in the video?
    Or am I very confused? :D

  • @Mark_Kop
    @Mark_Kop 5 років тому +6

    Hey, Ed! I'd like to suggest a React video about Hooks. I'm loving your channel, keep up with the good work

  • @pinkeHelga
    @pinkeHelga 4 роки тому

    It should have been looked more into the depth. `var` and `function` are function level declarations, `let` and `const` are block level declarations. Therefore the latter ones are not hoistet. You should also show what happens when there are the same names for functions and variables. Look at this `
    console.log(name);
    console.log(name());
    function name(){return 'FUNC1'}
    console.log(name);
    console.log(name());
    function name(){return 'FUNC2'}
    var name = 'VAR';
    console.log(name);
    console.log(name);
    function name(){return 'FUNC3'}
    console.log(name);
    console.log(name);
    `

  • @MRMOTOFOTO
    @MRMOTOFOTO 5 років тому +1

    Great simple explanations

  • @MANISHSHARMA-xk1su
    @MANISHSHARMA-xk1su 5 років тому +3

    Great Video...Really wanted it...let me know which theme you are using in your VS code...Its cool...

  • @danielbilic702
    @danielbilic702 5 років тому +1

    Love your VS Settings. Can you make a video about your VSCode settings would be nice.

  • @naveedalirehmani4135
    @naveedalirehmani4135 3 роки тому

    I knew all of these concepts already but I still watched it

  • @abcodemoldova1907
    @abcodemoldova1907 5 років тому +1

    Succese mai departe ! Salutari din Moldova :)

  • @swarajkaran
    @swarajkaran 3 роки тому

    var - undefined
    const - can't be accessed before initialisation.
    Why there's a difference? Both are variable declaration.
    Reason - Temporal Dead Zone

  • @simonbenjamin2976
    @simonbenjamin2976 5 років тому +3

    IIFE: Immediately Invoked Function Expression ~

  • @omsinha3572
    @omsinha3572 4 роки тому

    Thanks Ed, it was really awesome video and you make it very simple to understand...

  • @t74devkw
    @t74devkw 5 років тому +1

    PLEASE WHICH THEME IS THIS ON YOUR VSCODE??? The icons are so dope

  • @CarlosKimutai-p2g
    @CarlosKimutai-p2g Рік тому

    what I find hard about JS is methods. An example of them includes preventDefault and preventPropagation

  • @rezahosseini7851
    @rezahosseini7851 5 років тому +4

    Fullstack React app please! I know it's frustrating that your viewers want more and more and are never satisfied but you asked for it so I just did it!

  • @manuelsantos7807
    @manuelsantos7807 4 роки тому

    Thank you for the video Dev. What model and brand of camera and microphone did you used in this video?. Thanks in advance for the answer!

  • @maxwee5276
    @maxwee5276 4 роки тому +1

    Where can I find visual studio extensions like yours? Dev Ed bro?

  • @kid_kulafu_1727
    @kid_kulafu_1727 4 роки тому

    Hello. Nice tutorial. But one thing to clarify though on hoisting. Is the JS engine/compiler literally moving the code on top? I think this is wrong. There is an action happening before the execution phase, its the CREATION phase, in this phase all var declaration are marked as undefined, “theres no moving on top”. You can read this in spec or from medium post. I forgot but theres no moving on top.

  • @gasbill19
    @gasbill19 4 роки тому

    hoisting is very well explained! double thumbs up

  • @tryonqueenss
    @tryonqueenss 4 роки тому

    Dear Ed,
    You are my hero...u made me a front end developer within three months.thank u so much....I'm looking forward to seeing ur videos....ur d best thing dat happened to web development 🤓🤓@dev_Ed

  • @RockyDarlami7
    @RockyDarlami7 4 роки тому

    Awesome explanation. Thank you .

  • @ffgcvs
    @ffgcvs 5 років тому

    Could you explain on another video about what and when we need to use Promises / Then?

    • @acloudonthebluestsky9687
      @acloudonthebluestsky9687 5 років тому

      use promise when u have purpose for application to run on after 2009 browser
      asycn await for application after 2015 broswer
      if the customer require the app to run on the old things then use classic callback , which can be nightmare if u have 3+ callbacks lol

  • @raymondc5874
    @raymondc5874 4 роки тому

    Great content. Straight to the point.

  • @djlee0721
    @djlee0721 5 років тому +5

    Awesome video. Thank you!

  • @jeddals3613
    @jeddals3613 3 роки тому

    3:21 "Hello there"
    My reply
    "General Kenobi!"

  • @PouyaAtaei
    @PouyaAtaei 5 років тому +6

    Tutorial aside, you sound like such a great person :P cheers....

  • @aqibfayyaz1619
    @aqibfayyaz1619 5 років тому +1

    Thank you. Very helpfull

  • @DevlogBill
    @DevlogBill 2 роки тому

    OMG! DevEd, I am struggling with recursive functions!
    I don't know if I need recursions for this or maybe if I should use .math.random(); but I am trying to create a mineSweep game you normal find in a lot of PC Desktop computers. Basically, it is a grid normally 32 X 32 square blocks and the principle of the game is you have hidden mines within some of these blocks. Within the grid the blocks spawn and the mines spawn randomly when starting a new game. I am thinking hard and trying to figure out how to get the blocks and mines to spawn randomly using recursive functions. I was thinking maybe the algorithm Fibonacci would solve this issue? Or some other type of algorithm would work better? What is your recommendation? Thanks a million DevEd hope to hear from you and thank you for your excellent content.

  • @debugmedia
    @debugmedia 5 років тому +1

    What software do you use to create your Thumbnails ? Thank you for the video

  • @Amar11115
    @Amar11115 Рік тому

    Wow!
    Learned it by heart!

  • @oanamacarie5155
    @oanamacarie5155 5 років тому +1

    I love your style...makes me smile a lot. :)) Keep up the good work!!! :D

    • @vikasni95
      @vikasni95 4 роки тому

      Do u. Love him dev ed?

  • @softwareengineering6527
    @softwareengineering6527 5 років тому

    In my opinion, the harddet stuff in javascript is how to create the authentication server with, Nodejs, express, mongodb, twj...

  • @fmartinez004
    @fmartinez004 4 роки тому

    Hey Dev Ed, can you create a video on how you do your recordings and green screen setup?

  • @mdarifulhouqe3209
    @mdarifulhouqe3209 5 років тому +2

    hay Dev Ed!!! Make a video about working contact form in php for html template.

  • @sebailing6219
    @sebailing6219 4 роки тому

    Very good JavaScript Learn information!

  • @michaelzhu9075
    @michaelzhu9075 3 роки тому

    What is that "loupe"? What is the URL of it? I found it helpful. Thanks.

  • @mayurdugar03
    @mayurdugar03 5 років тому

    Nicely put! thanks

  • @sed_artis
    @sed_artis 5 років тому

    Nothing gets moved "to the top"! In the creation phase of the execution context, the parser sets up memory space for variables and functions, doesn't move code anywhere.

  • @TheMohsell
    @TheMohsell 5 років тому +1

    Thank you for the instructive video. JS, i tried to get my head around this language , but man , JS is just broken by design. thumbs up for those who can write big frameworks using it

    • @DJalem
      @DJalem 5 років тому

      Same here, 1 year JS but fighting with the fundamentals...

  • @jaimerojas6578
    @jaimerojas6578 4 роки тому

    Thanks a lot Ed this has been really really helpful for me it's crystal clear and well explained!

  • @SuboptimalEng
    @SuboptimalEng 5 років тому +1

    What vscode theme do you use???

  • @indianathe3rd742
    @indianathe3rd742 3 роки тому

    *Ed sneezes*
    Wap girl : Corona Virus!

  • @PablxVillarreal
    @PablxVillarreal 4 роки тому

    Love your videos dude!

  • @joshuaramin5245
    @joshuaramin5245 4 роки тому

    Hello, I am a newbie in javascript. May I ask how to practice logical thinking in programming

  • @AfzalKhan-ht2qk
    @AfzalKhan-ht2qk 5 років тому

    Hey Dev Ed! Nice video.. But what I have noticed when u are explaining IIFE at 11:47 there is a syntax error!! But as soon as you have saved the file the syntax error get removed. Can u tell us which extension you are using for VSCode.

  • @arjunvirhaan2204
    @arjunvirhaan2204 4 роки тому

    Dude you're amazing thanks alot

  • @benmor7021
    @benmor7021 3 роки тому

    Thank you (again) Ed !

  • @swoorp
    @swoorp 4 роки тому +1

    You said, gorgeous people, I'm missing gorgeous friends... Anyways love you Ed

  • @beatrizalmeidapires7246
    @beatrizalmeidapires7246 4 роки тому

    Very well explained, thank you!

  • @alejandrogomez8766
    @alejandrogomez8766 5 років тому

    Wooow, finally i understand async/await, thanks a lot 👌

  • @rakeshsontakke7570
    @rakeshsontakke7570 5 років тому +1

    Can you please make a video on JavaScript closure☺️

  • @jaimerojas6578
    @jaimerojas6578 4 роки тому

    What I feel about JavaScript might sound weird but It's that I don't know what I don't know, I mean I see all these frameworks, animations, behaviors and amazing stuff JavaScript is capable of but I don't know from my perspective what I can do with it or how to do it