Тёмный
No video :(

Methods and this keyword in javascript 

Hitesh Choudhary
Подписаться 935 тыс.
Просмотров 63 тыс.
50% 1

Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.
All the learning resources such as code files, documentations, articles and community discussions are available on our website:
chaicode.com/
You can find our discord link, github link etc on the above website.
Twitter/X link: x.com/hiteshdo...
Discord link: hitesh.ai/discord
Learn React with 10 projects: • Let's learn react from...
Learn Docker: • A practical guide on D...
Learn Kubernetes: • Complete Kubernetes Co...
How does a browser works: • How does a browser wor...
How nodejs works: • How node JS works | En...
Learn Redux-toolkit: • Learn Redux Toolkit in...
Learn NextJS: • Nextjs Full stack course
Learn Typescript: • Why to learn Typescript
Learn Javascript: • Welcome to new JavaScr...
Learn React Native: • React Native Mastery: ...
Learn Zustand: • React state management...
Learn Golang: • How to get started wit...

Опубликовано:

 

29 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 161   
@superbspandy4701
@superbspandy4701 4 года назад
Hi Hitesh, Hope you are doing good and just felt like telling you what my mind says about your lectures explanation is crystal clear and content you are providing is good Most important one is even if I'm watching continuously for hours together I'm not feeling bored and not losing the interest. i think this happens with every one for sure. fun learning it. Thank you:)
@lohithkumar8257
@lohithkumar8257 6 лет назад
Successfully completed my assignment in 2 min...All credit goes mr.hitesh sir....thanks a lot
@kukutlaashokinformation3144
@kukutlaashokinformation3144 4 года назад
Really super explanation when I watcheched about "this" by other tutorials I haven't understood, but after watching this really I got full picture in my mind. Thank you very much.
@clairecrabtree6821
@clairecrabtree6821 4 года назад
YES! That has been my problem trying to learn code. The same word is used over and over and I cannot tell if it a different element or not. Thank you for pointing that out!!!
@ManishJangir
@ManishJangir 6 лет назад
If you don't mind, I can tell "this" in 3 lines. AS LONG AS YOU DON'T USE "call, apply and bind", whatever is there before the called function is its "this". a.b.c() // a.b is "this" in function c abc() // nothing is there, window is "this" In case of using call, apply and bind, the first argument is "this". Ultimately determine "this" by who is calling the function. As simple as that. 😃 Great series! Thanks a lot Hitesh for helping people and this awesome work.
@auncon3151
@auncon3151 4 года назад
Your English accent is really good,man! love your videos and your personality :) go ahead bro...
@kazinoman3039
@kazinoman3039 5 лет назад
Sir I am new in java Script. I am start learning with u an its help me a lot. i am interested to learn nodeJs also. pls carry on and helping us. appreciate to u ,
@sarvangdave6215
@sarvangdave6215 4 года назад
This series is a great refresher, especially the assignments!
@michellejanay4704
@michellejanay4704 Год назад
Hi, I just wanted to say, thank you for using words like "fun" and "exciting" to describe JavaScript. I immediately subscribed due to your positive mindset! Too often people talk about how much they hate it or how hard it is, but I agree with you! It IS fun :D
@syedakib3534
@syedakib3534 4 года назад
Ohhh FINALLY!!! I've understood this keyword after wasting lots of time in other videos. I wish you'll read this comment, bcuz I just wanted to THANK YOU a LOTTT!!! Allah Bless You.
@KuldeepSolankiYT
@KuldeepSolankiYT 6 лет назад
Literally completed 22 videos in 2 days!
@abhishekmanoharan5260
@abhishekmanoharan5260 6 лет назад
24 here...!!!
@achintyaranjanchaudhary7122
@achintyaranjanchaudhary7122 6 лет назад
that's what i was looking for ...keep it up..
@AakashKumar-ru4gv
@AakashKumar-ru4gv 5 лет назад
Bhery Noice
@RahulKumar-zr5gu
@RahulKumar-zr5gu 4 года назад
not a big deal...
@astrix8812
@astrix8812 4 года назад
21 videos in little over 3 hours here. Obviously skipped some parts which are really just basics.
@voidvision1549
@voidvision1549 4 года назад
Hitesh Sir , Really thanks a lot .. Your tutorials are the best tutorials I've ever seen.
@mayanknagpal5989
@mayanknagpal5989 4 года назад
instead of this.meetings we could have simply used task.meetings, to get rid of the scope problem. Github source: we use this. to ensure that after changing your variable name e.g. from user to something your code still works. Other than that, I imagine that (on some browsers) there may be some performance gain too, since with user.name browser has to lookup in context outside your function while using this.name sticks to current context.
@official.mhm13
@official.mhm13 4 года назад
You made my confusion clear at 11:34 Thanks a lot
@prasannapilankar6260
@prasannapilankar6260 4 года назад
Best video on this keyword,I've seen so far on the RU-vid most probably bestest one🤘🤘🤘
@pavantejavydhik7354
@pavantejavydhik7354 6 лет назад
hey Hitesh, please help by making a video to understand this keyword in Java as well, pls, your teaching is best approach to understand tricky/neche topics pls
@stringsc120
@stringsc120 5 лет назад
I fixed the logical problem by removing the default value of meetDone then change - by + in the meetDone function body and finally I can substract todo.meetings - todo.meetDone in the getSummaryOfDay function. It lead to the same result with different approach.
@prakharagarwal40
@prakharagarwal40 6 лет назад
I am enjoying this series and learning so much from them.
@whalewalker9176
@whalewalker9176 4 года назад
Who is here 2020, i love this guy
@yashdubeyofficial
@yashdubeyofficial 6 лет назад
It's morning time and still peoples are awake awesome man!
@amolacharya5342
@amolacharya5342 5 лет назад
Very nice tutorial Mr. 'THERE WE GO'!
@playwithdata2635
@playwithdata2635 4 года назад
Writing in comment coz you said you read all of them. yes i am liking very much your videos. Learned a lot from you. Thanks. If you are really reading my comment i would like if you reply it.
@HiteshCodeLab
@HiteshCodeLab 4 года назад
Yes I am. Mostly
@jasonkadayat8168
@jasonkadayat8168 4 года назад
No doubt you are a great instructor 💯💯
@SoumyaranjanMohanty-nn6pk
@SoumyaranjanMohanty-nn6pk 6 лет назад
Way of teaching is just wow...could you please tell the ncs sounds you play on starting of the video , thats awseome. thank u
@Bajrang.707
@Bajrang.707 5 лет назад
Of course, enjoying a lot! Thanks for this series :)
@maximilianjulian5426
@maximilianjulian5426 3 года назад
You prolly dont give a shit but does any of you know of a way to log back into an Instagram account? I was dumb lost my login password. I would appreciate any tips you can offer me
@ismailbenchekroun9869
@ismailbenchekroun9869 2 года назад
you are the best
@manishbatgiri2210
@manishbatgiri2210 5 лет назад
Yes sir loving this series, keep it up. Great teaching style.
@ahmedtaimoor
@ahmedtaimoor 4 года назад
console.log(changeVideoLenght(myObject).formate2); // The above method is also working sir , //In the below method as per your instruction is a little log code then the above // But for better understanding one must follow the below method let adOne = changeVideoLenght (myObject) console.log(adOne.formate2); #mythoughs
@komalmishra5451
@komalmishra5451 4 года назад
During lockdown me : Getting lot of assingment from university, i will noy do this Hitesh : hey are you excited about assingment Me :surely yes, what's the task 😋🥰
@krishnanandshenoy2841
@krishnanandshenoy2841 4 года назад
You've made javascript easy to learn✌️thank you
@sumanth_g
@sumanth_g 4 года назад
this flow made me easy to learn JS.
@udaykhatri8290
@udaykhatri8290 4 года назад
functions are not working and got converted into classes automatically this is what VS code shows, This constructor function may be converted to a class declaration.
@saddamahmad2310
@saddamahmad2310 5 лет назад
thank you very much sir for this video these videos are really helping us a lot
@ShivamSharma-iq6zb
@ShivamSharma-iq6zb 6 лет назад
Its awesome Sir. Please keep making such videos, it means a lot to me.
@MrFahimansari
@MrFahimansari 4 года назад
Very nicely explained. Keep it up
@vaibhavgaware1710
@vaibhavgaware1710 5 лет назад
Thanks a lot sir. U have Unique teaching technique
@natakam2649
@natakam2649 5 лет назад
awesome videos I am watching each and every video buddy Thanks a lot
@roshi143
@roshi143 5 лет назад
Grt work!!! nice way to teach.. each video is stepped nicely
@YogeshKumar-bp5dr
@YogeshKumar-bp5dr 5 лет назад
So interesting so far... Fun learning!!!
@Reels-Tak
@Reels-Tak 5 лет назад
Doing Great Job! learnt a lot from these videos. thanks.
@sparshagrawal3506
@sparshagrawal3506 4 года назад
//Assisnment //Handle meeting done //Create a function that can reset entire day. let myTodos1 = { day: 'Monday', meetings: '5', meetsdone: '7', addMeetDone: function (num1) { this.meetsdone = (this.meetsdone + num1) }, reset: function () { this.meetings = 5; this.meetsdone = 7; } } myTodos1.addMeetDone(12); myTodos1.reset(); console.log(myTodos1);
@babjipolisetti5010
@babjipolisetti5010 4 года назад
❤️guru...👌
@hamzafaysal909
@hamzafaysal909 6 лет назад
doing great job! make this series at least 100 videos long.... n thanks for sharing knowledge..
@arankinogon2059
@arankinogon2059 3 года назад
nice easygoin course for starters
@aiswarya5848
@aiswarya5848 5 лет назад
What is the difference between using myTodods.meetings and this.meetings inside the function??
@balachanderharivarsha9757
@balachanderharivarsha9757 5 лет назад
I have the same doubt. Both are giving the same output.
@DurgaPrasad-zo2lq
@DurgaPrasad-zo2lq 3 года назад
one doubt hitesh, this keyword is updating the key meetings is it correct? when you called the second function it logged the updated meetings value.
@user-dl6et4cn9w
@user-dl6et4cn9w 5 лет назад
Hi sir, first of all thank you so much for these wonderful videos really helped me a lot I have a question I am trying this keyword with function inside the method but it is not working
@gelfordpenaranda4213
@gelfordpenaranda4213 3 года назад
I tried to use arrow function but the result was an empty object? Is there difference ? let myTodos = { day: 'Monday', meetings: 0, meetingDone: 0, addMeeting : () => { console.log(this) }, }; myTodos.addMeeting()
@_echoheim
@_echoheim 4 года назад
let work = { day:'mon', meetings: 0, done: 0, addmeeting: function(todo , meet = 0) { this.meetings = todo.meetings + meet } } console.log(work) work.addmeeting(work, 4) console.log(work)
@mdsajaldeowan1054
@mdsajaldeowan1054 6 лет назад
#you are great Hitesh Sir.....!!!!!!
@saynotobakwaas7831
@saynotobakwaas7831 4 года назад
Super Clear Bro
@saynotobakwaas7831
@saynotobakwaas7831 4 года назад
let myTodos = { day: "Monday", meeting: 0, meetDone: 0, addmeet: function(num) { this.meeting = this.meeting + num; }, meetingDone: function(num) { this.meetDone = this.meetDone + num; }, remaining: function() { let remain = this.meeting - this.meetDone; if (remain < 0) { return `Error`; } else if (remain === 0) { return `No meeting left for today`; } else return ` the remaining meeting${remain} for the ${ this.day } The total meetings were ${this.meetDone + this.meeting} Thank you`; } }; myTodos.addmeet(4); myTodos.meetingDone(2); console.log(myTodos.remaining());
@kumarkanav
@kumarkanav 5 лет назад
Started 3 days back...and looking forward to complete it and many more. Thanks Hitesh.
@arjayarjay8856
@arjayarjay8856 3 года назад
Thank you Sir
@bhaveshsachanandani5704
@bhaveshsachanandani5704 6 лет назад
Hi Hitesh..nice videos..had one query like todo parameter of addMeeting method is able to use meetings property of myTodos object directly??..we haven't explicitly declared anything like todo=myTodos..pls correct me if I am wrong..
@deepakchawla1105
@deepakchawla1105 6 лет назад
i am big fan of you sir and your are also my ideal
@suriyas2457
@suriyas2457 4 года назад
program: let javascript={ name:'suriya', cost:23.4, asurred:'yes', displaycost:function() { console.log(this.cost) }, changeName:function(newName) { this.name=newName }, } console.log(javascript) console.log(javascript.displaycost()) javascript.changeName('sutha') console.log(javascript) output: { name: 'suriya', cost: 23.4, asurred: 'yes', displaycost: [Function: displaycost], changeName: [Function: changeName] } 23.4 undefined { name: 'sutha', cost: 23.4, asurred: 'yes', displaycost: [Function: displaycost], changeName: [Function: changeName] } doubt: why its printing undefined after printing cost
@milandevprasai2070
@milandevprasai2070 4 года назад
Hi Hitesh i am going through your Js tuotrial from the beginning, i am bit confuse what is the difference between console.log and document.write which we used to manipulate html and css. I have studied Java script back in 2011 but i am starting it again. Is there any other souce i can contact you directly. Pls Respond. Thank you
@akhlaq510
@akhlaq510 5 лет назад
is semi-colon(;) necessary to type in js at the end of the object
@avinashsinghaniya8033
@avinashsinghaniya8033 3 года назад
helpful thank you
@rabindrajoshi9258
@rabindrajoshi9258 6 лет назад
Waiting for more 🤗
@umair.dev996
@umair.dev996 3 года назад
Impressive..
@alphamuhanguzi4545
@alphamuhanguzi4545 6 лет назад
let myToDos = { day:'Tuesday', meetings: 5, meetDone:3, resetMeeting: function(){ this.day = 'Monday' this.meetings = 0, this.meetDone = 0 }, summary: function(){ return `You have reset to ${this.day} having ${this.meetings} meetings with ${this.meetDone} left` }, } myToDos.resetMeeting() console.log(myToDos.summary()) there were 3 dots that appeared in the code at the resetMeeting function...what do they mean?
@rajeshwarprasad9061
@rajeshwarprasad9061 5 лет назад
Who is here in 2019!
@calebagoha8001
@calebagoha8001 5 лет назад
Me
@waqariqbal1724
@waqariqbal1724 5 лет назад
i'm
@abdulhamidkhorajiya2256
@abdulhamidkhorajiya2256 5 лет назад
yes
@user-wb5ox7nw2u
@user-wb5ox7nw2u 5 лет назад
me brooo
@ruinfirefly2088
@ruinfirefly2088 4 года назад
2020 here
@erfanasgari21
@erfanasgari21 6 лет назад
I LOVE U HITESH!
@stackbind4728
@stackbind4728 5 лет назад
Just wow!
@deepakchawla1105
@deepakchawla1105 6 лет назад
this is loving
@deepakjangra6531
@deepakjangra6531 6 лет назад
let dj={title:'javascript', author:'deepak jangra',rate:'10000'}; console.log(' here we have ${dj.title} by ${dj.author} and the rate is ${rate}'); please checkout this code nd lemme know what was the error . in the result my object values are not printed .
@akshayad3228
@akshayad3228 5 лет назад
How does scope play a role in the "this" keyword. Please explain. I got confused when you said scope.
@GoutamReddydazz
@GoutamReddydazz 6 лет назад
In php properties of class has no $ signs so it can be easily detected the use of $this-> keyword in PHP oops . i like php syntax because it helps me to understand programming patterns .
@musasalumu3142
@musasalumu3142 6 лет назад
i am waiting for the next lecture.this is amazing but i still can not see the machine learning course in my account
@anshulsharma3137
@anshulsharma3137 6 лет назад
Keep going sir 😋😋👍👍
@vibhukumar7327
@vibhukumar7327 6 лет назад
I'm learning so many things...
@AshutoshKumarak007
@AshutoshKumarak007 6 лет назад
Awesome
@chintannyalvani4733
@chintannyalvani4733 4 года назад
hello sir i am getting an error in addMeetings (property object) when i use "this" to access meetings. vs code says : this constructor function may be converted to a class declaration.ts(80002) please help
@Imranbof
@Imranbof 4 года назад
It's very easy to learn. All credits goes to you. I wish I will meet with you once.
@studentsproductions3049
@studentsproductions3049 5 лет назад
Sir why we go for reset function
@prakasha916
@prakasha916 5 лет назад
instead of using this.meeting we can also use myTodos.meeting right at 11:56??
@ronit5104
@ronit5104 6 лет назад
Nice job
@gagan4579
@gagan4579 6 лет назад
I'm really willing to creat a website....so what are the languages that i should learn
@supreetlaghate22
@supreetlaghate22 4 года назад
hello sir, please make a tutorial series on ASP.NET MVC and C#
@saptarshitah4716
@saptarshitah4716 5 лет назад
there is some error output showing in your given assignment ....
@niravpatel2382
@niravpatel2382 4 года назад
yes
@ujjwalbansal1070
@ujjwalbansal1070 6 лет назад
in 10:22 you have used this.meeting = this.meeting + num to assign the num value to meeting but i have tried also "myTodo.meeting =myTodo.meeting +num " i am getting the same answers as yours . waht is the diffrence in that....???
@NewbieeCreator
@NewbieeCreator 5 лет назад
No difference but for how many times you will be writing myTodos.meeting/meetDone... Instead direclty write 4 letter work "this"
@sumitsingh7505
@sumitsingh7505 6 лет назад
Yes....
@rajshekharrakshit9058
@rajshekharrakshit9058 4 года назад
is it same like self keyword in python
@charugoel3435
@charugoel3435 6 лет назад
Yes
@jashanshetty5899
@jashanshetty5899 5 лет назад
when I'm passing tod as parameter , an error is coming. Can anyone help?
@delicionmichael3992
@delicionmichael3992 6 лет назад
nice bro
@donalshijan5615
@donalshijan5615 4 года назад
2: 22 almost wrote fun coitus.
@vinodbellamkonda9452
@vinodbellamkonda9452 5 лет назад
var person = { firstName:"John", lastName:"Doe", age:50, eyeColor:"blue", fullName: function(){ document.write("Jhon Doe") } }; document.write(person.fullName()) jondoeundefined can any one please correct me on this
@azharjamal7334
@azharjamal7334 5 лет назад
I guess its because you are using print statement inside the "fullName" function and again you are using the print statement outside the object. I have used the same code and i got the following result. var person = { firstName:"John", lastName:"Doe", age:50, eyeColor:"blue", fullName: function(){ return 'John Doe' } }; console.log(person.fullName()) Output: John Doe
@georgenonis5967
@georgenonis5967 3 года назад
Do you still read them tho?(comments)
@zinyt2.0
@zinyt2.0 Год назад
let myToDos={ day:'wed', meetings:0, meetDone:0, addMeetDone:function(num){ this.meetDone=this.meetDone+num; }, reset:function(){ this.meetings=5; this.meetDone=7; } } myToDos.addMeetDone(12); myToDos.reset(3); console.log(myToDos) correct it sir if i done something wrong in programe
@debuggedtraveling8047
@debuggedtraveling8047 6 лет назад
What's Trellov .....sorry i cant get it
@sourishdutta9600
@sourishdutta9600 5 лет назад
var student = { name : "Shoaib", sayname : function() { console.log(this); var abjqdq =5; var bar = function() { console.log(this); } bar() } } student.sayname(); console.log(bar); console.log(abjqdq); VM504:4 {name: "Shoaib", sayname: ƒ} VM504:7 Window {postMessage: ƒ, blur: ƒ, focus: ƒ, close: ƒ, frames: Window, …} VM504:14 () => { console.log(this.name); } VM504:15 Uncaught ReferenceError: abjqdq is not defined at :15:13 (anonymous) @ VM504:15 can You please explain to me why this function bar is getting the global scope and if the bar is getting global scope then why (abjqdq ) variable is getting the local scope of that method (sayname). And also why the bar (function) is getting the window context when it is called into the sayname object.Appreciate your hard work.Thank You so much. Please let me know the reason behind this.
@rezowantalukder
@rezowantalukder 6 лет назад
love
@Script_Sage
@Script_Sage 4 года назад
7:29 Do you still use Windows Phone. :(
@mananpatel9802
@mananpatel9802 4 года назад
well, that's a OnePlus ringtone, so its android ;)
@vimalsingh3544
@vimalsingh3544 6 лет назад
can anybody tell me how to give user input in javascript
@dengbeny
@dengbeny 6 лет назад
you can take user input with help of html using input tag..
@michaelwoodruff5752
@michaelwoodruff5752 6 лет назад
Hey a fellow vscode guy
@HiteshCodeLab
@HiteshCodeLab 6 лет назад
Vscode buddies
@rajeevmayekar1775
@rajeevmayekar1775 5 лет назад
getting nan error in meet done
@shashank664
@shashank664 4 года назад
I'm also getting the same, found solution?
@dynamicdance2872
@dynamicdance2872 3 года назад
Hey!!!, I am a function. I hope no on will delete me.
Далее
Username and Password checking basics in javascript
15:36
Maps and for of loop in javascript
22:35
Просмотров 44 тыс.
Reforged | Update 0.30.0 Trailer | Standoff 2
02:05
Просмотров 810 тыс.
Arrow function basics in javascript 😃
13:41
Просмотров 65 тыс.
The JavaScript Survival Guide
14:47
Просмотров 725 тыс.
Var and let keyword - Scope in Javascript
9:47
Просмотров 77 тыс.
WTF Do These Even Mean
13:44
Просмотров 84 тыс.
3 Must know methods for Arrays in javascript
11:16
Просмотров 65 тыс.
THIS keyword - Beau teaches JavaScript
8:48
Просмотров 58 тыс.
Arrays and Template literals in javascript
13:24
Просмотров 71 тыс.