Functions & Methods – JavaScript Tutorial for Beginners

What is a function? In JavaScript, a function is a named block of code that can be invoked from anywhere within the code. You can pass arguments as parameters, and assign the return value to a variable. The difference between a function, a method, and a sub-routine is basically what programming language is involved. They practically mean the same thing, but different programmers like to argue about the particular technical differences.

Copyright (c) 2013 Rodrigo Silveira http://www.easylearntutorial.com

Comments

I'm learning coding says:

Thank you Sir! It was a real help! And why can’t others explain “scope” and “this” this easily?
I’ve been literally spending weeks trying to understand them… as well as property…

Amit says:

Can you plz explain the different way of explaining function inside JavaScript.
I always got confused to understand the syntax and scope of a function in different place with different needs.
like:-
1. function x(){}
2. var x = function y(){}
3. var x = {
myFunction: function (){return this.name; }}
So there are many way to declare your function and I dont know how and when we have to do that.
Can you plz explain.
Thanks

ujwal agarwal says:

alert(whatIsmyname());
it is not working ,please tell me what is the reason behind it,also please tell me how to call that function inside that object

Three One says:

1000 thumbs up! Super helpful.

Zhanibek Seitzhanov says:

Thanks! This video was very useful to me

musicaffionado says:

Finally, an explanation I understood. Thank you.

tubemonkie says:

Thanks, this helps with my concept understanding! 

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours