Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Writing JavaScript classes

    I have seen some JavaScript code written in the form of classes in which methods are added on to an initially defined function's prototype.

    This is a very new way of writing JavaScript for me though I would like to understand how this works.

    Can anyone explain the in's and out's of this or point me to a few good tutorials on the matter?

    I have tried searching Google but mainly turn up information on modifiying the "class" property.

    Thanks in advance!

  • #2
    Regular Coder
    Join Date
    Jan 2005
    Posts
    470
    Thanks
    3
    Thanked 0 Times in 0 Posts
    While browsing the forums in search of something unrelated I stumbled upon these web sites:
    http://www.chunkysoup.net/advanced/oojavascript1/
    http://www.sitepoint.com/article/oriented-programming-1

    This holds the majority of the examples I was looking for, while the two above explain more OO details of JavaScript.
    http://www.peterbailey.net/dev/jsclasses/

    I am trying to arrive at an understand of JavaScript object-oriented programming from a PHP object-oriented perspective.

    Am I mistaken or does the use of the "this" keyword work slightly differently in some manner in JavaScript?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •