22: How to Create Object Constructors | Object Constructors in JavaScript | JavaScript Tutorial

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 143

  • @hilkokriel5659
    @hilkokriel5659 5 лет назад +22

    You watch hundreds of videos and just don’t get it, then you discover this channel and the universe makes sense. Thanks for being such an awesome teacher!!

  • @chair_smesh
    @chair_smesh 3 года назад +6

    This is the best type of tutorial. Explained right away and not 20+ minutes of showing off your typing speed.

  • @ericbiscayne6722
    @ericbiscayne6722 2 года назад

    I ought to thank you Daniel for going rather slow when you're showing concepts like this. Some people (like I) need to read or watch this video more than once to fully understand them, and not flying through gives us (beginners) the opportunity to asimilate it all well. Thanks!!!

  • @izaakchater9165
    @izaakchater9165 5 лет назад +15

    Awesome tutorials, trying to learn coding basically from scratch and I'm finding codeacademy by itself pretty difficult to remember the concept so tutorials like this where a person breaks it down piece by piece are invaluable.

  • @rubenlozano3478
    @rubenlozano3478 3 года назад

    Mann... it's crazy how some random RUclipsr could teach me a concept that my professor with 20 years of experience in Programming couldn't with such simplicity and easily understandable explanation. Thank you!

  • @habibikushal9738
    @habibikushal9738 3 года назад

    Thank you soon much, your teachings have allowed me to educate myself on programming from home , self - taught by you as my teacher.
    🇿🇦 love from south africa

  • @YOUTUBE_IS_WOKE
    @YOUTUBE_IS_WOKE 4 года назад +2

    Your tutorial is very well-organized and right-paced, not to boring and not too complicated, unlike the many tutorials I've seen in Pluralsight and Lynda where I lose interest due to boring stuff.

  • @OladimejiAdegbayibi
    @OladimejiAdegbayibi 3 года назад

    I have watched several videos to learn constructors but I never understood it. But this video just gave me better understanding of it. God Bless you.

  • @castro6612
    @castro6612 4 года назад +3

    You're helping me a lo Dani! That's why I am not skipping the ads if ever there's an ads in your youtube video

  • @OzzySpearman
    @OzzySpearman 2 года назад

    Daniel, I spent much time looking at different videos ,articles and other media trying to wrap my mind around this concept. Your lecture made it finally click. Thank you for a great explanation!

  • @barbelliusshrug8363
    @barbelliusshrug8363 2 года назад

    Amazing info bruh, all these years of studying and you explained it so well in just 10 minutes

  • @imeldaizaguirre6003
    @imeldaizaguirre6003 5 лет назад +2

    Where have I been! All I can say is thank you! Your tutorials are nothing like numerous boring tutorials that I've watched. I actually get it! Thanks!!

  • @sterling3419
    @sterling3419 2 года назад

    I watched a couple of other videos on this topic and I was still confused but when I saw Danny made a video on it I was like "thank God" because I knew he'd explain it well and indeed he did

  • @casisi6983
    @casisi6983 3 года назад

    english is not my first language ,I've seen several videos about .this method usage with confusing, but now I kind of knowing some about it from this video, thanks.

  • @MrAverageViewer
    @MrAverageViewer 4 года назад

    Your teaching style is friendly, easy-to-understand, and concise!! Always appreciated!!

  • @alexintech254
    @alexintech254 4 года назад

    so far the best explanation i have found on the topic

  • @davidcurry1893
    @davidcurry1893 2 года назад

    Thank you! This is the best explanation of Object Constructors that I’ve watched.

  • @jasonh8556
    @jasonh8556 4 года назад

    One of the easiest tutorials to follow, simple and to the point. 👍

  • @eatyourgarden
    @eatyourgarden 6 лет назад +15

    You are awesome my friend On behalf of everyone, thankyou :)

  • @rohailtaha9518
    @rohailtaha9518 4 года назад

    Your javascript tutorials are amazing. Especially the projects are very interesting. Watched all your html and css videos and now learning javascript. Thanks a lot Daniel.

  • @BryanDike-vh2fj
    @BryanDike-vh2fj 6 лет назад +3

    Hello Daniel, you are doing an amazing job here! Thank you so much. You are one of the best online tutor i have ever come across! I am enjoying this tutorial a whole lot. I can wait till we are done to see how much i will be able to learn under your tutelage!

  • @israphial
    @israphial 4 года назад

    Hey! Your videos have been popping up a lot during my searches. Your videos are really high quality! Thank you!

  • @kenkioqqo
    @kenkioqqo 3 года назад +1

    Amazing teaching, Dani. I love your work. Your tutorials are really turning me into a coding expert. Thanks a lot.

  • @ericmwangi2188
    @ericmwangi2188 2 года назад

    Great tutorial Daniel- I'm new to JS & I'm loving every inch of this.

  • @_chrxtopher
    @_chrxtopher 3 года назад

    Thank you! I’ve been debugging for hours, I really appreciate this!

  • @Vincent-fs8ry
    @Vincent-fs8ry 6 лет назад

    Still best quality channel in youtube like ur style in these videos they seem like premium stuff

  • @acatisfinetoo3018
    @acatisfinetoo3018 4 года назад +1

    You are a great teacher. I am so excited for this series:)

  • @rohitr6722
    @rohitr6722 9 месяцев назад

    love the way this is taught, learnt a lot :)

  • @jcs7757
    @jcs7757 5 лет назад +1

    WOW. so well explained, only useful details. Thanks from Brazil

  • @MrAverageViewer
    @MrAverageViewer 4 года назад

    You tutorials are fantastic!! Thank you for providing these very easy-to-understand lessons!! I greatly appreciate your ability to simplify these concepts!! Looking forward to more lessons from you!!

  • @geraldfoushee
    @geraldfoushee 6 лет назад

    Daniel, you are really a great teacher. you understand what its like to be seeing some of this stuff for the first time and that is great. seems like javascript has changed a lot over the past couple of years. at once it seemed all about events and updating web pages. objects was one of those things people never talked much about in a beginners class. The whole idea of JS is sorta like and endless journey. it make me feel like no matter what we learn, there is always more. when does a person know JS....that is a question you should do a video on in my opinion. what is the end goal so to speak.
    var js= 5150
    if (js == 5150)
    {alert( "the boy's mind got hung in an endless loop ");}
    else{alert( "all is well that ends well");}

  • @NERO-ez1mn
    @NERO-ez1mn 6 лет назад +34

    please make more exercises senpai, we may know the basics but we don't know how to apply it on the app :-((

    • @soundrogue4472
      @soundrogue4472 4 года назад +1

      The point of exercise is FOR YOU to apply your knowledge.

    • @AhmetBD1
      @AhmetBD1 3 года назад +1

      YAMETEEEE!!

    • @NERO-ez1mn
      @NERO-ez1mn 3 года назад

      @@soundrogue4472 fyi. we don't know how to apply the exrcises we we don't even have the experience to build a real world app prototype. how to link the frontend to backend. use data attributes on htmls. local storage. json server. mongo db. we just need a simple app. even a calculator may work or to do list.

    • @soundrogue4472
      @soundrogue4472 3 года назад

      @@NERO-ez1mn well sucks to be you because I've been learning.

    • @NERO-ez1mn
      @NERO-ez1mn 3 года назад

      @@soundrogue4472 you are just learning some beginner exercises for a decade and you compare me to you? HOLY u only learning things taht you already learned some years ago and you boast of being GROWING? are you kidding me?

  • @sahilkassanjee802
    @sahilkassanjee802 4 года назад

    You explain things so well. Thank you

  • @FerLaGo
    @FerLaGo 2 года назад

    Man¡ I just fxxxxx love u¡¡¡ You are helping me and making me to undestand JS so so fast. Danke für alles.

  • @ranjanrnj6864
    @ranjanrnj6864 5 лет назад +1

    good understandable tutorial, thank you

  • @ivonapanajotov5812
    @ivonapanajotov5812 4 года назад

    I like the Kurama chilling in the back

  • @Anonymous-qv5ym
    @Anonymous-qv5ym 6 лет назад +2

    Very informative, thank you so much! Keep up the great work!

  • @shahadhazem6115
    @shahadhazem6115 4 года назад

    Amazing explanation, please do more

  • @neerajsinghjr
    @neerajsinghjr 5 лет назад

    Already Completed your both Javascript Playlist and Jquery is in Queue. Thanks ! (Like Your Dog and your hairstyle Bro !)

  • @marcelmuusz7427
    @marcelmuusz7427 5 лет назад

    awesome, finally I understand objects! thx

  • @ArmaanM123
    @ArmaanM123 2 года назад +1

    Question: if i have created many objects using the constructor, how do use the x of only one later in js and change/delete it?

  • @jacobsiegel9144
    @jacobsiegel9144 6 лет назад +1

    Thanks for making these videos!! You’re a great teacher. I look forward to the next video :).

  • @santiagobenitezperez3365
    @santiagobenitezperez3365 4 года назад

    super useful vid! thanks so much, keep it up!

  • @StrategicFishing101
    @StrategicFishing101 4 года назад

    Great explanation

  • @cheating_story
    @cheating_story 4 года назад

    Well explained, You're awesome friend

  • @davidilunga2384
    @davidilunga2384 2 года назад

    Thank you!!! helped me out alot

  • @offline._archive
    @offline._archive 4 года назад

    wow your tutorial is so easy to follow along. Thank you so much!

  • @ashwin372
    @ashwin372 4 года назад

    Really good tutorials thanks

  • @robscherer
    @robscherer 3 года назад

    Great video, thank you!

  • @sarasmedlund1215
    @sarasmedlund1215 4 года назад

    Little late to find you but great videos! :D helping me a lot!!

  • @wais4148
    @wais4148 5 лет назад

    it really helped me, bro!
    I like the way or method you teach us.
    hope you more successes.
    @support you from Afghanistan.

  • @limitless0032
    @limitless0032 3 года назад

    Nice Explanation

  • @ofarukdogancay
    @ofarukdogancay 6 лет назад

    Love you guys! Can u make a chit-chat like video with Tom Scott? I think he would be really interested in.

  • @codingtime3803
    @codingtime3803 4 года назад

    Thanks so much! Great tutorial !

  • @samantha6670
    @samantha6670 3 года назад

    Thanks Dani!

  • @salmalakhlifi1901
    @salmalakhlifi1901 4 года назад +1

    Ah I see it's like structures on C, that's kinda cool because it makes learning easier.

  • @user_16309
    @user_16309 5 лет назад

    Bravo sir, bravo!

  • @mariamminasian3197
    @mariamminasian3197 4 года назад

    really enjoyed! thank you >>>

  • @Miabeach22
    @Miabeach22 5 лет назад

    Awesome videos. Thanks!!!!

  • @chahalpawanpreet
    @chahalpawanpreet 3 года назад

    that's clean bruh

  • @CameronChardukian
    @CameronChardukian 5 лет назад +1

    "We have a let" -- Haha, I like that way of referring to the variable!

  • @markdunn756
    @markdunn756 4 года назад

    Great video. Subscribed.

  • @arunkumarram
    @arunkumarram 6 лет назад

    Awesome Daniel 💙

  • @rohitbani2615
    @rohitbani2615 2 года назад

    thanks for this.

  • @shinevisionsv
    @shinevisionsv 6 лет назад +3

    Awesome!

  • @elementfayt
    @elementfayt 5 лет назад

    Great Video!

  • @patriciamendes7557
    @patriciamendes7557 4 года назад

    Cool. Congrats!

  • @ehabtalaat7592
    @ehabtalaat7592 5 лет назад +1

    please make more exercises on real webpages

  • @nahidasultana8985
    @nahidasultana8985 4 года назад

    you are just awesome man!!!!

  • @tamtakobiashvili5452
    @tamtakobiashvili5452 5 лет назад

    Thank you

  • @akautosport
    @akautosport 6 лет назад

    Very helpful. Thank you.

  • @dg_dotnet9616
    @dg_dotnet9616 4 года назад

    Really Smart

  • @stefaniaia6615
    @stefaniaia6615 6 лет назад

    Very good, thank you !

  • @nomadicpulse9693
    @nomadicpulse9693 4 года назад

    Daniel thank you for your hard work making us awesome tutorials. This is a lot to learn and I just want to know when can I use this method? I learn all these different theories is JS but have no clue when to use them in a project. Could you perhaps give some examples of projects or website functions that uses this kind of object? Would be great if you can show examples of real-life projects that uses the codes that you have shown us so someone like me would have a better idea of how and when to use JS functions. Thank you so much.

  • @ahmedelgaidi
    @ahmedelgaidi 4 года назад

    well done

  • @deepika2830
    @deepika2830 4 года назад

    bruhhh THANK YOU

  • @Pspisripoff
    @Pspisripoff 4 года назад

    @mmtuts - Question.. How can i save this (update it) in an existing file with some objects in it already? I cant save this info into an actual file just virtual memory, as soon as i refresh the page, this info for arrays delete it self and javascript file havent changed at all...?

  • @gothamfury
    @gothamfury 4 года назад

    Could you also store several objects into any array? For example: let person = [ new Person("Sam","Brown",24), new Person("Lucy","Blue",21), new Person("Kate","Green",26) ]

  • @yongjung5433
    @yongjung5433 6 лет назад

    I love your exercises part! I think they make your tutorials unique from others'! if that makes sense :p

  • @yu-jyunlin1566
    @yu-jyunlin1566 6 лет назад

    love it!

  • @Anthony-wg7fn
    @Anthony-wg7fn 4 года назад

    I’m just learning, but it seems like there is a way for someone to input the values of each person from outside the jS file.
    So, how would one do that?
    I was thinking that this is a way to make a profile for someone in a database or a way to generate an enemy in a game. In the instance of a profile, the person would input their own data On a website and that information would create a new person in the jS file. Is my thinking correct?
    Or in the case of the enemy in a game, instead of recreating all the attributes you simply just run the function with the object again to create a similar enemy.

  • @aseel1024
    @aseel1024 5 лет назад

    thx bro!

  • @thanhtung24
    @thanhtung24 4 года назад

    Thank you so much, you saved me

  • @michael.ahearn
    @michael.ahearn 3 года назад

    Hi Dani, good tutorial. Just one question: why do you use let and not const for object - and even the instances? Just curious.

  • @jakestone6793
    @jakestone6793 5 лет назад

    instead of person01, person02, person03 etc.. is there a ay to just assign person as an array? like aPerson = [] as person? not sure how to do that. Makes sense?

  • @siamesedev3646
    @siamesedev3646 4 года назад +1

    RIP Kobe

  • @ermirakajtazi5841
    @ermirakajtazi5841 6 лет назад

    What if we want to console all the persons in the object, not just person01 but all of them at one time. How do we do it ?

  • @moemyintmaung9891
    @moemyintmaung9891 3 года назад

    I see the Kurama beside the vest

  • @thomascarlton82
    @thomascarlton82 3 года назад

    This vid is a gem!!!! Good s##t bro

    • @Dani_Krossing
      @Dani_Krossing  3 года назад +1

      Thanks! Just had one and it was juuuuuust right!

  • @WhateverComestoMind-qk2nl
    @WhateverComestoMind-qk2nl 4 года назад

    Object always starts with capitalized letter but you named object person with small letter in the previous episode.can you please explain when i need capitalized letter and when i not?

  • @JD-kf2ki
    @JD-kf2ki 2 года назад

    We can't use "getter" within constructor function, can we?

  • @Yash-Gaikwad
    @Yash-Gaikwad 3 года назад

    I like this way. Why even classes exist?. Functions can do the same. 🙄 Right?..

  • @sonoftroy8572
    @sonoftroy8572 5 лет назад

    mmtuts! I was wondering if you can help me work something out... if I create a html form for a user, how does the users data create a new instance of a JavaScript object using Object Oriented Programming... using console.log() will allow you to test sample data on the console, but if a user inputs information into a form... does that data create a new object then send that data to the constructor???? i'm not really sure how that works and i'd like to know what your thoughts are on that thanks

    • @josepharenas8905
      @josepharenas8905 5 лет назад

      Get the input thru the DOM and use the data to create an object thru a constructor

    • @sonoftroy8572
      @sonoftroy8572 5 лет назад

      Joe Lawren, thanks for the reply, I was wondering if you don’t mind would you be able to show an example so I can see the code. Thanks

  • @blackburd
    @blackburd 2 года назад

    I like this but I wish I coudl create the object iterations dynamicly. I mean... what if I have 1000 employees?

  • @shabs0009
    @shabs0009 6 лет назад

    Which software are you using for html and CSS?? Is it Dreamweaver??

  • @muramasa7537
    @muramasa7537 6 лет назад

    How similar is C# in accordance to JS ? I've seen that Unity doesn't support js anymore . Should i change game engine or learn Js for web development only ?

    • @Dani_Krossing
      @Dani_Krossing  6 лет назад +2

      C# is much better for game development in the long run, which is probably why Unity doesn't support JS anymore. JS is mainly meant for web dev, so learning C# isn't a bad idea if you are interested in game development. C# isn't difficult to learn either once you get the basics so go for it :) Similarity wise in Unity, I would say that C# and JS mainly differ in the libraries that are build into them, and if you got to experience using JS in Unity you will notice that we use a lot of namespaces and classes in C#, where as JS was mainly focused around objects. I personally use C# in Unity and only tried creating a game using JS once back when I was still studying at the university, and I will say that even though JS might seem easier to learn at first it pays off to learn C# instead.

    • @muramasa7537
      @muramasa7537 6 лет назад

      mmtuts yea , I've seen C# has namespaces n classes where Js mainly focuses on objects , which becomes hard later on if we wanna change the code or something . I will still tag along with JS for web development btw , thank you :)

  • @superreverbfreak
    @superreverbfreak 5 лет назад

    total newb here but how do you connect this to if statements

  • @Bruno-ds8ze
    @Bruno-ds8ze 6 лет назад

    Awesome like all you videos, the title is not 22 ?

  • @sunitmody6064
    @sunitmody6064 4 года назад

    What is the ++person.age all about (I'm confused about the "++") part.

    • @PrakashReddy0506
      @PrakashReddy0506 4 года назад

      ++ is the increment operator, you could check it by calling the property which we defined inside the Person object. you can simply console.log(person01.updateage());
      This will increment the age by 1 and print it.
      Here's the full code
      //constructor
      function Person(name,eye,age){
      this.name=name;
      this.eye=eye;
      this.age = age;
      this.updateage = function(){
      return ++this.age;
      };
      }
      //instance
      let person1 = new Person("daniel","blue",27);
      console.log(person1); //will print whole object
      console.log(person1.updateage()); // will print incremented age which is 28

  • @karthickdurai2157
    @karthickdurai2157 4 года назад

    how do we print the entire object;
    as I got [object object]; when I try to log

    • @PrakashReddy0506
      @PrakashReddy0506 4 года назад

      you cannot print the object Person() directly, instead print the instance you created. which is person01 in this video
      console.log(person01); //will print the entire object