Functions vs Methods in Programming

AI whiteboard video · 142s · landscape

0 views
Rate it

Key moments

Want a video like this?

Create your own AI whiteboard & doodle videos from a prompt, PDF, image or URL — free to start.

Create your video

Share & embed

Embed this video on your site or blog — the snippet adds a small credit link.

Full transcript

Hello, everyone! Welcome to Gascony GH Tech. Have you ever wondered what the difference is between a Function and a Method in programming? Don't worry — I'll explain everything in simple terms, even if you're completely new to programming. Let's start with a Function. A function is a reusable block of code designed to perform a particular task. Think of it like a calculator: whenever you need to perform a calculation, you simply use it. For example, imagine a function called greet. When we call this function, it displays the message Hello, World! Here is a simple JavaScript example: function greet() { console.log("Hello, World!"); } greet(); Notice that we can call the function directly without needing an object. Now, let's understand a Method. A method is a function that belongs to an object or a class. Think of a smartphone. It has different actions, such as calling, taking pictures, and sending messages. These actions can be represented as methods in programming. Look at this JavaScript example: const phone = { call: function() { console.log("Calling..."); } }; phone.call(); Here, call() is a method because it belongs to the phone object. Notice that we access it using the object name followed by a dot. Let's quickly understand the difference. A function can work independently and is called directly. A method belongs to an object or class and is commonly accessed through that object or class. Remember these two examples: greet() — Function. phone.call() — Method. Here is the most important thing to remember: every method is a function, but not every function is a method. Congratulations! You've just learned the difference between Functions and Methods in programming. Follow Gascony GH Tech, also known as Heroes Never Give Up Tech, for more beginner-friendly technology lessons. Remember: Heroes Never Give Up!

Functions vs Methods in Programming was created with Whiteboard Video Maker, the AI doodle video maker that turns any prompt, PDF, Word document, image or URL into an engaging whiteboard animation video — complete with AI script, hand-drawn illustrations and a natural voiceover.

Make explainer videos, tutorials, how-to guides, marketing and e-learning content in minutes. Start free at whiteboard-video.com and publish your first whiteboard video today.

Make your own whiteboard & doodle videos

Get Started Free →