Это видео недоступно.
Сожалеем об этом.

Functions in Javascript | Javascript Functions Tutorial

Поделиться
HTML-код
  • Опубликовано: 12 авг 2024
  • Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
    In this video we'll look at examples of Functions in Javascript and learn how to create our own functions that are blocks of reusable code!
    ▶ This video is part of the JavaScript Tutorials for Beginners Playlist found here: • Javascript Tutorials f...
    ✅ Quick Concepts outline:
    Functions in Javascript
    (00:00) Intro
    (0:15) Built-in Functions
    (0:55) Functions are reusable code blocks
    (1:12) Function Declaration Syntax
    (1:20) Creating a Basic Function: sum()
    (2:09) Calling a Function into action
    (2:50) Passing Parameters to a Function
    (3:30) Creating Reusable Code with Functions
    (3:50) Missing Parameters
    (4:30) Handling Missing Parameters
    (5:20) Another Function Example: getUserNameFromEmail()
    (7:10) Is it reusable? Yes!
    (7:30) Anonymous Functions
    (8:30) Arrow Functions
    (9:05) Creating One More Function: toProperCase()
    📚 Further Reading:
    MDN Web Docs:
    Functions: developer.mozilla.org/en-US/d...
    Eloquent JavaScript Chapter 3:
    eloquentjavascript.net/03_fun...
    📺 More Beginner JS Videos:
    freeCodeCamp: • Learn JavaScript - Ful...
    Traversy Media: • JavaScript Crash Cours...
    The Net Ninja: • Modern JavaScript Tuto...
    ✅ Follow Me:
    Twitter: / yesdavidgray
    Reddit: / daveoneleven
    Medium: / davegray_86804
    #Functions #Javascript #Tutorial

Комментарии • 27

  • @reked2605
    @reked2605 2 года назад +6

    I love how you give a simple example and then a practical example that you would use in a real life scenario. So many tutorials don't do this... thank you so much

  • @alan-overthenet
    @alan-overthenet Год назад +1

    Really good explanation and useful examples. Thank you, Dave

  • @akshayasalaskar9102
    @akshayasalaskar9102 Год назад

    Thank you for such a simple explanation!!!!

  • @StellaOloo
    @StellaOloo Год назад

    Best explanation ever on functions ever!!! Thank you Dave Gray.

  • @Cascadia2011
    @Cascadia2011 3 года назад

    Excellent explanation and a great teaching voice! Thank you 😊

  • @fazzyakamello
    @fazzyakamello 3 года назад

    I’m so glad I bumped into your channel. Thanks to Traversty Media! Keep it up

  • @srinivasaraoyp3640
    @srinivasaraoyp3640 2 года назад +1

    Very interesting and very important topic , thank you very much Dave.

  • @harapalb7
    @harapalb7 3 года назад

    Keep up the good work!

  • @CondeAlberto
    @CondeAlberto 2 года назад

    Well done as usual

  • @Grihlo
    @Grihlo 2 года назад

    Your method of explanation is just the best! No water, only essential useful and practical information. Thank you!
    I wonder why is it preferrable to define functions with 'const' instead of 'let'?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 года назад +1

      Thank you! I always use const instead of let when possible. let indicates the value being defined could change. const indicates the value cannot change.

    • @Grihlo
      @Grihlo 2 года назад

      @@DaveGrayTeachesCode thank you for reply! I posted this question before I watched another video where you explained in details the different ways to declare variables - var, let, const. Now I know the difference! Thank you again for proper explanation of basics!

  • @jiweihe3413
    @jiweihe3413 2 года назад

    Thanks for these helpful videos. Is "return" usually removed from arrow functions? 11:30

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 года назад +1

      Good question. If it is on one line, it can be omitted. If multiple lines, then it must be included.

  • @omcinc
    @omcinc Год назад

    Thanks for the great JavaScript series! I notice as you're typing JS code, you have a pop-up helper showing you a description of the method and parameters it accepts... What is this extension please?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Год назад +1

      I don't remember what I was using at the time. Search your extensions for MDN, and there are several options for this.

  • @B-Billy
    @B-Billy 2 года назад +1

    Thanks for the video, however, are not the latter two "Fucntion Expression"?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 года назад +1

      It has been over a year since I made this tutorial, so I am not sure of the specific last two. That said, function expressions are still considered to be functions. I usually call them anonymous functions. MDN shares some distinction here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function

  • @aetherwebdev3620
    @aetherwebdev3620 3 года назад

    I'd say it's a Good Explanation.
    But, aren't Methods Functions that are attached to a Class or An Object.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  3 года назад

      Yes they are. Objects and classes are covered in a later "chapter" of the playlist. However, some built-in string and math methods were covered in earlier "chapters" of the playlist. 👍