Classes and objects in javascript

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ย. 2024

ความคิดเห็น • 105

  • @flarepaints5516
    @flarepaints5516 4 ปีที่แล้ว +9

    This is honestly the best class tutorial I've seen. I just needed to know the syntax but literally, every time I googled it, I would just be confused by people who weren't answering my question. Thank you so much for this video.

  • @mayanksati1842
    @mayanksati1842 4 ปีที่แล้ว +4

    Thank you for such a nice video.
    class User{
    constructor(firstname, lastname, credit, middlename){
    this.firstname = firstname;
    this.lastname = lastname;
    this.credit = credit;
    this.middlename = middlename;
    }
    addMiddleName(middlename){
    const fullname = middlename.split(' ');
    console.log('New name for adding middlename',fullname);
    this.middlename = fullname[1];
    console.log(`Updated name: ${this.firstname} ${this.middlename} ${this.lastname}`);
    }
    }

    • @vishwasyadav6775
      @vishwasyadav6775 4 ปีที่แล้ว +2

      sorry bro but it didnt work for all no problem ill give u my source code and make yours correct :) :
      class User {
      constructor(firstname, middlename, lastname, age) {
      this.firstname = firstname;
      this.middlename = middlename;
      this.lastname = lastname;
      this.age = age;
      }
      getfullname() { return `the full name of user is ${this.firstname} ${this.middlename} ${this.lastname}`; }
      editname(newname) {
      const myname = newname.split(' ');
      this.firstname = myname[0];
      this.middlename = myname[1];
      this.lastname = myname[2];
      }
      }
      const John = new User('John', 'don','anderson', 38);
      // console.log(John);
      console.log(John.getfullname());
      John.editname('johnny depp anderson');
      console.log(John.getfullname());

  • @Monika-xh7er
    @Monika-xh7er 3 ปีที่แล้ว

    I am a python programmer and wanted to learn javascript basics quickly in 1 day, your videos helped me a lot because you made it from a coder's perspective, simple and right on point. Thank you buddy.

  • @surendrareddyreddy1913
    @surendrareddyreddy1913 6 ปีที่แล้ว +6

    "Thank you soooo much for this wonderfull and spoonfeeding series sir" ,i was confused when i saw the code of angular js or react and... some stuff on them ,But these basics will help everyone to go through all the advanced topics on javascript

  • @developerpranav
    @developerpranav 4 ปีที่แล้ว +2

    came to watch this again after a few months.
    You have to keep revising this stuff :)

  • @pranabacharya1572
    @pranabacharya1572 4 ปีที่แล้ว

    Thank you Hitesh 😃
    class User {
    constructor(fname,mname,lname,salary){
    this.firstname = fname;
    this.middlename = mname;
    this.lastname = lname;
    this.salary = salary;
    }
    fullname() {
    return `${this.firstname} ${this.middlename} ${this.lastname} is my fullname`;
    }
    changename(value) {
    const part = value.split(" ");
    this.firstname = part[0];
    this.middlename = part[1];
    this.lastname = part[3];
    }
    };

  • @skillfulactor09
    @skillfulactor09 5 ปีที่แล้ว +1

    why are you the best teacher in the whole world oh my please tell me how I can explain and communicate like you i wish i can have you in my pocket and you appear and give me explanions that any one can understand you explain so well that there is no need for questions because you answer everything great and everything is understood your very patenice and kind God bless you please never stop you are changing the world

    • @skillfulactor09
      @skillfulactor09 5 ปีที่แล้ว

      May I ask you a question hopefully you can answer with the new react updated version are you going to update your react course that you have on Udemy ? Also I was wondering if your going to do a vue.js. Course or a typescript course thank you

  • @shivanshsahu4908
    @shivanshsahu4908 4 ปีที่แล้ว +2

    Just watched a 3 minute ad so that I can contribute a bit to you for providing such an useful course

  • @ForCodingInterview
    @ForCodingInterview 3 ปีที่แล้ว

    You are great instructor & explain them well

  • @GeniusCoders
    @GeniusCoders 6 ปีที่แล้ว +1

    Hello sir, my name is Nilesh and I am following your javascript course. It is really helping me to get started with javascript from basics. I followed every video of Javascript. so my question is can I start learning react.js where I already bought your udemy course of React in last month but haven't started it... or do I need to do any advance javascript course or any node.js which are available on udemy(or any other online website including yours)
    I hope I get reply as soon as possible because I am so excited to learn react and want complete some future projects. 😀

    • @HiteshCodeLab
      @HiteshCodeLab  6 ปีที่แล้ว +1

      You can visit Learncodeonline.in
      Few courses are exclusive for LCO.
      Keep programming!

    • @GeniusCoders
      @GeniusCoders 6 ปีที่แล้ว

      Thank You Sir It's really great to learn with you :)

  • @mradulgupta9626
    @mradulgupta9626 6 ปีที่แล้ว

    Hitesh is back with another video on this lovely js series😍😍🙌🙌🙌

  • @mohd.abdulla581
    @mohd.abdulla581 4 ปีที่แล้ว

    i completed my bootcamp on udemy, i didnt know its was you !!

  • @cm17070
    @cm17070 6 ปีที่แล้ว +1

    Why you have chosen .in domain for your website

  • @vinitkumar2767
    @vinitkumar2767 5 ปีที่แล้ว +1

    class Test {
    constructor(name,address) {
    this.name=name;
    this.address=address;
    }
    myFun(name,address){console.log(`Hi this is ${this.name} from ${this.address}`)};
    //one line implementation
    }
    const info=new Test("vinit","Delhi");
    info.myFun();

  • @ArjunSingh-uu8qz
    @ArjunSingh-uu8qz 6 ปีที่แล้ว

    As you travel a lot and stays in hotels, have you ever wondered about spying hidden cameras. If yes then You should create a video on how to find out these hidden Cams, or how you tackled such situations

    • @HiteshCodeLab
      @HiteshCodeLab  6 ปีที่แล้ว +3

      I think I can make a travel hack and tips playlist on this channel :)

  • @aaronbaraiya3692
    @aaronbaraiya3692 4 ปีที่แล้ว +1

    Here is the whole thing:
    class User {
    constructor(name, middle, lastName) {
    this.name = name;
    this.middle = middle;
    this.lastName = lastName;
    }
    greetUser() {
    return `Hello ${this.name}`;
    }
    editName(newName) {
    const edit = newName.split(" ");
    this.name = edit[0];
    this.lastName = edit[1];
    }
    middleName() {
    return `Name: ${this.name} ${this.middle} ${this.lastName}`
    }
    }
    const person = new User("Aaron", "Baraiya");
    console.log(person);
    console.log(person.greetUser());
    person.editName("BOB -700");
    console.log(person.greetUser());
    console.log(person.middleName());

  • @yashrajanshukla7790
    @yashrajanshukla7790 6 ปีที่แล้ว +9

    Yesterday I was acting like you ("hey there every one ,hitesh here back again with another video") and then suddenly my mom scolded me and she said ..Jao padhai karo

  • @sukhwindersingh-kz8zd
    @sukhwindersingh-kz8zd 2 ปีที่แล้ว

    @hitesh, your blog seems not working..!

  • @santoshe61
    @santoshe61 4 ปีที่แล้ว

    What's the difference between ? if yes then which is better way and why
    class User {
    construct(name){
    // do some assignments
    }
    }
    let user = new User()
    and
    let User = function (){
    // do some assignments
    }
    let user = new User()

  • @niketanchandarana
    @niketanchandarana 6 ปีที่แล้ว

    And you have surely caught up us..😉😁😁

  • @danishjamal104
    @danishjamal104 6 ปีที่แล้ว

    Wow we r doing awsm in this course . Reached classes n objects . Im excited😁

  • @chinmaydas1946
    @chinmaydas1946 6 ปีที่แล้ว

    yes, sir,we are enjoying the series

  • @yashrajanshukla7790
    @yashrajanshukla7790 6 ปีที่แล้ว

    Always you are my motivation and inspiration ..

  • @nageshthotakura8758
    @nageshthotakura8758 4 ปีที่แล้ว

    Always nice as usual.

  • @LAXMANKUMAR-kq7cx
    @LAXMANKUMAR-kq7cx 5 ปีที่แล้ว +1

    Bro i didn't understand classes
    i have enrolled in Lambda class but he is teaching something different fronm you

  • @shivanshu2959
    @shivanshu2959 4 ปีที่แล้ว

    There we go !!

  • @sudhakarkumar4553
    @sudhakarkumar4553 3 ปีที่แล้ว

    plss.... help me!!!
    At video starting there is a file with name jsonhandle.js and there is no video of that file .. can any one tell me that video... previous videos i am not get that video ... this is continuous ..so can please anyone tell me that previous video...

  • @adeleyeadedolapo1145
    @adeleyeadedolapo1145 3 ปีที่แล้ว

    why didnt we have to define the arguments in the constructor before using them. how do we ensure encapsulation in javascript(data hiding)

  • @manirsg9641
    @manirsg9641 6 ปีที่แล้ว

    It would be great if u explain ML with tensorflw.js..so we can move further

    • @HiteshCodeLab
      @HiteshCodeLab  6 ปีที่แล้ว +1

      I am thinking to include that in my ML course.

  • @sachintiwari5871
    @sachintiwari5871 6 ปีที่แล้ว

    Great explanation sir.....luv u sir .....sir can you please take lecture in my clg????im from Mumbai

    • @HiteshCodeLab
      @HiteshCodeLab  6 ปีที่แล้ว

      You can drop invitation at hitesh@hiteshchoudhary.com
      would love to visit more campus.

    • @sachintiwari5871
      @sachintiwari5871 6 ปีที่แล้ว

      Great sir ..... I will drop invitation sir

  • @kamrannawaz5106
    @kamrannawaz5106 5 ปีที่แล้ว

    why still many people using constrtuctor function instead of class.. is it right or worth it plz sugggest me what i use by the way i know very well about classes because already learnd in php java and c#

  • @r0x304
    @r0x304 4 ปีที่แล้ว

    editName(name) {
    return name.split(' ').join(' ');
    }
    getMiddleName(name) {
    // \s+ - checks for any type of white space.
    return name.split(/\s+/)[1]
    }

  • @rajchhatrala5988
    @rajchhatrala5988 6 ปีที่แล้ว

    why not, we are enjoying the series

  • @wantedwilson4925
    @wantedwilson4925 5 ปีที่แล้ว +2

    I'm following your course
    and your kind of my teacher and i should respect you
    but i should say an algae knows programming better than you
    honestly dude
    😕😕😕
    I don't know maybe you're very nervous while recording
    but your voice seems very calm

    • @ceazykid
      @ceazykid 5 ปีที่แล้ว

      mohammad reza rasoli what are you talking about this was a great video and very well explained

    • @wantedwilson4925
      @wantedwilson4925 5 ปีที่แล้ว +1

      @@ceazykid if you were a professional programmer you would understand that he has a lot of mistakes . he is just good at speaking in front of camera but he is a absolute amateur in programming

    • @vikrraal
      @vikrraal 4 ปีที่แล้ว

      @@wantedwilson4925 dude can you advice where to learn JS properly ? I feed this series is not well taken care of in youtube.. some videos are missing , not much exercises etc problems are here.. I want to be an advanced propagrammer and solve problems

    • @wantedwilson4925
      @wantedwilson4925 4 ปีที่แล้ว +1

      @@vikrraal there is a quite goob documentation for JS in firefox website and that is the main reference . I myself search a lot to find a goob and complete tutorials for JS but there is none . You should learn part by part from this website and that website and test code snippets and sample programs . good luck

    • @vikrraal
      @vikrraal 4 ปีที่แล้ว +1

      @@wantedwilson4925 thank you for advising broda

  • @nishchay79
    @nishchay79 3 ปีที่แล้ว

    Why do not we use let or const or function keyword in class when we define any function or variable?

  • @prashanthkumar0
    @prashanthkumar0 6 ปีที่แล้ว +1

    I want you help sir ...
    I am too confused..
    😿
    I have started with php and I know its basics concepts like working with files and database ...
    in your video I saw that php is now old and you suggested node instead of php..
    I don't have any experience in node js so what to do next should I learn node or stick with php...
    will there be job security if I choose php ..
    please make a video I am really confused ....😭😭😭😭😭😭😭😭

  • @MegaRonnie2
    @MegaRonnie2 3 ปีที่แล้ว

    8:09, that's what she said. Sorry, couldn't hold myself back from commenting.

  • @mukurajpoot6550
    @mukurajpoot6550 5 ปีที่แล้ว

    Sir I create a class airplane whose constructor name, occupancy, speed.
    Name boing777
    Occupancy 180
    Speed 800
    How can I add method increaseSpeed and decreaseSpeed which accepts single parameter which a value of speed to increase / decrease by existing speed.

  • @venkatchalam6385
    @venkatchalam6385 2 ปีที่แล้ว

    yes ,same doubt also why? use again getfull name

  • @ishansharma9152
    @ishansharma9152 5 ปีที่แล้ว +1

    What is difference between constructor in classes and constructor function in JavaScript?

    • @spartansgrs
      @spartansgrs 4 ปีที่แล้ว

      constructor is special method that is used to construct a object of a class.

  • @daniphordmwajah2840
    @daniphordmwajah2840 4 ปีที่แล้ว

    Hi my name is Daniphord I would like to take coding to the next level. would you be there to help?

  • @darshitgajjar5199
    @darshitgajjar5199 6 ปีที่แล้ว

    SAR make more more video in JavaScript.i am enthusiastic to learn JavaScript and ES 6

  • @vivekvanga3588
    @vivekvanga3588 6 ปีที่แล้ว

    Thank you sir... Awesome js series...

  • @aakashranjan8944
    @aakashranjan8944 6 ปีที่แล้ว

    Sir i am not able to update my windows its says fail installation and i do face blue screen but now i am not able to enter in safe mode also,Its say dignosis but doesent do anything

  • @DeepSingh-jo8th
    @DeepSingh-jo8th 3 ปีที่แล้ว

    hello dear sir i have written same code but get error (undefined ) please provide this code

  • @Markkkkkkkkkkkkkkkkk
    @Markkkkkkkkkkkkkkkkk 4 ปีที่แล้ว

    I need help
    I didn't get much the difference between a class and a function
    They both look familiar
    When time use classes and when to use functions?

  • @vaibhavjain6995
    @vaibhavjain6995 6 ปีที่แล้ว

    Sir why you always wear grey t-shirt any Lucky item or something....!!

  • @happychuckprogramming6048
    @happychuckprogramming6048 5 ปีที่แล้ว

    good video. very informative.

  • @saqlainrasheed2268
    @saqlainrasheed2268 6 ปีที่แล้ว

    sir there is a request for you can you please explain oop for us because of many students cannot able to undrstand that thing and I'm one of them.

  • @jerryandsimba341
    @jerryandsimba341 4 ปีที่แล้ว

    Can you tell me why we use class ...what is the use of class

  • @antoniosalzano5253
    @antoniosalzano5253 4 ปีที่แล้ว

    Difference between a normal function and a class?

  • @MrApacis
    @MrApacis 5 ปีที่แล้ว

    You didn't explain why you used '.this' in both places, like 'this.credit = this.credit' and didn't do the same with the above elements.

    • @vishwasyadav6775
      @vishwasyadav6775 4 ปีที่แล้ว

      @@KayoNar8892 you are correct i think he didnt watch the full video correctly

  • @prashanthkumar0
    @prashanthkumar0 6 ปีที่แล้ว +1

    I want advanced es6 tut 😍😍

  • @DeepSingh-jo8th
    @DeepSingh-jo8th 3 ปีที่แล้ว

    its showing same name not showing edited name how to fix it sir ?

  • @mohitvaishnav7283
    @mohitvaishnav7283 6 ปีที่แล้ว

    keep it up air 😇😇

  • @shubhamsharma-pu2sp
    @shubhamsharma-pu2sp 6 ปีที่แล้ว

    Hey sir I can't download brackets any extension in brackets

  • @deepamishra1737
    @deepamishra1737 4 ปีที่แล้ว

    How to fill colour

  • @darshitgajjar5199
    @darshitgajjar5199 6 ปีที่แล้ว

    SAR I want to became just like u

  • @sandipmajumder120
    @sandipmajumder120 6 ปีที่แล้ว

    Love you

  • @alv1947
    @alv1947 5 ปีที่แล้ว

    takeFullName() {return `${this.firstname} ${this.lastname} is my full name.`;

  • @AaruZone
    @AaruZone 5 ปีที่แล้ว +1

    $ sign kyu use kiya ?

    • @nehukingdom4963
      @nehukingdom4963 5 ปีที่แล้ว

      tume pta nhi itna bhi pagal

    • @nitinnagpal3816
      @nitinnagpal3816 5 ปีที่แล้ว +1

      @@nehukingdom4963 nahi pta wo mostly $ sign php mein use krte yaah jquery mein magar idr kyu samaj nhi aa raha

    • @AaruZone
      @AaruZone 5 ปีที่แล้ว +1

      Tu btade phir

    • @kajalsharma6570
      @kajalsharma6570 4 ปีที่แล้ว +1

      @@AaruZone its called string templating in javascript instead of using this.firstname+this.lastname+"is my full name" we are using `${this.firstname} ${this.middlename} ${this.lastname} is my full name`.

    • @AaruZone
      @AaruZone 4 ปีที่แล้ว +2

      @@kajalsharma6570 thank you so much 😊

  • @prashantindurkar
    @prashantindurkar 6 ปีที่แล้ว

    1st

  • @ShubhamSharma-ud4tv
    @ShubhamSharma-ud4tv 5 ปีที่แล้ว

    Too Much Ads

  • @saiEraboina
    @saiEraboina 3 ปีที่แล้ว +1

    Madda guduv

  • @pujasingha181
    @pujasingha181 2 ปีที่แล้ว

    assignment
    getMiddleName() {
    let middlename = `${this.firstname} ${this.middlename} ${this.lastname} is my full name `
    return middlename;
    }
    editName(newname) {
    const myname = newname.split(' ')
    this.firstname = myname[0];
    this.middlename = myname[1];
    this.lastname = myname[2];
    }
    }
    john.editName('Johnny Doe Anderson')
    console.log(john.getMiddleName())