Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #8360

Re: JavaScript: Object Definition Extension

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!fu-berlin.de!uni-berlin.de!not-for-mail
From Jake Jarvis <pig_in_shoes@yahoo.com>
Newsgroups comp.lang.javascript
Subject Re: JavaScript: Object Definition Extension
Date Tue, 15 Nov 2011 23:35:46 +0100
Lines 39
Message-ID <9ig7q2Fj0tU1@mid.uni-berlin.de> (permalink)
References <887pb7titjugv9u6j6tiv9cjpdv8t6div7@4ax.com> <5d71fb87-8e00-4c50-96db-4ad31589600b@u5g2000vbd.googlegroups.com> <Ts$F80E5FYvOFwbw@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD> <cdvrb7d6ijld51jl1jd2hfksmf8vae95i4@4ax.com> <YuSnExEkLqvOFw7y@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD> <96u2c7lqsl0sg7v34fd99a4294jqrojih7@4ax.com> <GO8h8OImiowOFwDj@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD> <6qb5c75u67t4jg60v5ipc11qu6e4d5it0h@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de eUDrsjRAogAbA69IWeUSAATkftrPsGbw1+XTsxy+2p3QwOs98=
User-Agent Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
In-Reply-To <6qb5c75u67t4jg60v5ipc11qu6e4d5it0h@4ax.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.javascript:8360

Show key headers only | View raw


On 15.11.2011 19:31, Gene Wirchenko wrote:
> On Tue, 15 Nov 2011 15:43:34 +0000, John G Harris
> <john@nospam.demon.co.uk>  wrote:
>
> [snip]
>
>> However, back when I was writing my javascript note 'call' was new and
>> not in all popular browsers so an older clumsier way was needed.
>> Remember that if you do  a.b()  then the function b is called with the
>> 'this' value set to a. So, we create a property of the Commercial object
>> under construction with the name 'base' (because that's what Netscape
>
>       My question is why a property.  Why not just
>            var base=...
>
>> called it and there isn't a really better name), and use it to hold the
>
>       As there could be multiple levels, "base" is potentially
> confusing.  Visual FoxPro uses "parent".
>
>> function object RealEstate. Now it's easy :
>>
>>   this.base(PropertyLocation, PropertyValue);
>>     // 'this' is the new Commercial object
>>
>> After using it you delete the temporary property 'base' because it's no
>> use for any other job.
>
>       But if you had declared it with var, you would not need to do
> this.
>
>       What am I missing about base's definition?
<snip>

The idea is to have 'this' inside the function you assigned to base
refer to a certain value.

-- 
Jake Jarvis

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JavaScript: Object Definition Extension Gene Wirchenko <genew@ocis.net> - 2011-11-10 20:02 -0800
  Re: JavaScript: Object Definition Extension "Evertjan." <exjxw.hannivoort@interxnl.net> - 2011-11-11 08:49 +0000
  Re: JavaScript: Object Definition Extension beegee <bgulian@gmail.com> - 2011-11-11 05:40 -0800
    Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-11 20:11 +0000
      Re: JavaScript: Object Definition Extension Gene Wirchenko <genew@ocis.net> - 2011-11-11 21:02 -0800
        Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-12 16:46 +0000
          Re: JavaScript: Object Definition Extension Gene Wirchenko <genew@ocis.net> - 2011-11-14 12:26 -0800
            Re: JavaScript: Object Definition Extension beegee <bgulian@gmail.com> - 2011-11-15 06:49 -0800
              Re: JavaScript: Object Definition Extension beegee <bgulian@gmail.com> - 2011-11-15 09:47 -0800
            Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-15 15:43 +0000
              Re: JavaScript: Object Definition Extension Gene Wirchenko <genew@ocis.net> - 2011-11-15 10:31 -0800
                Re: JavaScript: Object Definition Extension Jake Jarvis <pig_in_shoes@yahoo.com> - 2011-11-15 23:35 +0100
                Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-16 20:42 +0000
      Re: JavaScript: Object Definition Extension beegee <bgulian@gmail.com> - 2011-11-12 09:35 -0800
        Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-13 11:40 +0000
          Re: JavaScript: Object Definition Extension beegee <bgulian@gmail.com> - 2011-11-13 11:53 -0800
            Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-14 16:19 +0000
              Re: JavaScript: Object Definition Extension beegee <bgulian@gmail.com> - 2011-11-15 10:02 -0800
  Re: JavaScript: Object Definition Extension Elegie <elegie@anonymous.invalid> - 2011-11-12 12:53 +0100
    Re: JavaScript: Object Definition Extension Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-12 16:04 +0000
      Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-12 18:14 +0000
        Re: JavaScript: Object Definition Extension Denis McMahon <denismfmcmahon@gmail.com> - 2011-11-13 19:34 +0000
      Re: JavaScript: Object Definition Extension Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-11-12 19:31 +0100
      Re: JavaScript: Object Definition Extension Gene Wirchenko <genew@ocis.net> - 2011-11-13 20:33 -0800
    Re: JavaScript: Object Definition Extension John G Harris <john@nospam.demon.co.uk> - 2011-11-12 16:52 +0000
      Re: JavaScript: Object Definition Extension Elegie <elegie@anonymous.invalid> - 2011-11-12 20:49 +0100
        Re: JavaScript: Object Definition Extension Gene Wirchenko <genew@ocis.net> - 2011-11-13 20:21 -0800
          Re: JavaScript: Object Definition Extension Elegie <elegie@anonymous.invalid> - 2011-11-14 10:20 +0100

csiph-web