Class JavaScript Classes Tutorial

Class JavaScript Classes Tutorial
Spread the love


How’s it going guys my name is dom and    today i want to. Talk about  in    javascript so    basically for those of you. Who haven’t    ever used  before    a class is used to create one or more. Objects so    you can think of an object as being    a    creation from a definition so . These  aren’t actually used    directly by your program logic but they    used. To create objects now these objects    are the ones that actually. Used by your    program to achieve different things. So    with that being said    you can define    two main areas with a class definition .


   you can define what an object will have    so this is called an instance property    and also what they do this is called an    instance method so    with instance properties    taking into basically example of a human    being a human might have a name    an age and a height so    an instance property describes the    current state of that object what they    have it’s basically just data about that    property sorry that objects so    these instance properties are unique to    every object which is created from that    class definition    so    we now have the instance methods.


this is    what they do so an instance method    for a human being    might be to talk to run and to jump so    this refers to what they actually do    what actions    and their behavior so    typically an instance method will use    the instance properties to achieve    their result    so those two main areas right there so    let’s now create a in javascript    so    down here    we can create a  definition by    using the  keyword    let’s type out like that    followed by the name of your    let’s create a  for a rectangle  .




Leave a Reply

Your email address will not be published. Required fields are marked *