JavaScript for Beginners #45 Object Methods

preview_player
Показать описание
Here, we will talk about methods in JavaScript. A method is just a function which is attached to an object.

0:00 What is a Method in JavaScript
0:40 Setting up an object
2:00 Setting up a calcAge function
5:28 Changing the return value
6:32 Changing calcAge into a method
9:00 What is the this keyword and why do we use it
10:35 Changing up our calcAge function
11:09 Adding in our fullName method
12:41 Adding in our canVote method
15:24 Creating one long string using all three methods

JavaScript Playlist:

MDN Objects:

MDN Methods:

Node JS:

Visual Studio Code:
Рекомендации по теме
Комментарии
Автор

These are so clear and easy to understand, can't wait to watch them all and repeating the examples on my own. Thank you for this resource!

AnaRamirez-ngtj
Автор

Thanks for the video. Just one question here, wouldn't it be counterproductive to have specific functions inside an object? What if we wanted to create a number of different persons objects, then we would have to repeat the same code for a number of times. I haven't seen the rest of the newest videos yet, so I am guessing that you have already explained that in one of them ;)

laponiec