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


Groups > comp.lang.javascript > #14704

Re: JS newbie and Array newbie

From Gregor Kofler <usenet@gregorkofler.com>
Newsgroups comp.lang.javascript
Subject Re: JS newbie and Array newbie
Date 2012-06-27 11:00 +0200
Organization A noiseless patient Spider
Message-ID <jsei3e$p8k$1@dont-email.me> (permalink)
References <d1e9e795-70bd-498d-8e0d-48511a59cf37@googlegroups.com>

Show all headers | View raw


Am 2012-06-27 02:16, schrieb robert@theaustinfamily.us:
> Okay, I've been around coding for about 15 years (consider myself more of a data analyst that uses programming as a tool, rather than a full fledged programmer). So, I know my way around OOP. However, I have never needed to use an Array, but I get the basic concept down - and I *do* know how to search to find out what I need, unfortunately, this one is stumping me. I'm trying to enter the code I have found as closely as possible, and just changing the names to be specific to what I want, instead of using the typical "c", or "x", etc.
>
> Here is what I have - and isn't working for whatever reason;
>
>    function myPlanet(inPosX, inPosY, inName) {
>          this.posX = inPosX;
>          this.posY = inPosY;
>          this.myName = inName;
>      }
> this is *supposed* to create a new "planet" object (called myPlanet)
>
> and I call this function with the following code
> var objPlanets = new myPlanet(myX, myY, ****);
>
> ** my "planet name" - for the time being, I was wanting to use the combination of myX and myY and no matter what I try to place into the name variable, I can't get it to work!

*What* is not working? There are no obvious bugs in your script. On a 
side note: constructors should start with an uppercase letter.


Gregor

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


Thread

JS newbie and Array newbie robert@theaustinfamily.us - 2012-06-26 17:16 -0700
  Re: JS newbie and Array newbie Stefan Weiss <krewecherl@gmail.com> - 2012-06-27 02:37 +0200
    Re: JS newbie and Array newbie RoLaAus <robert@theaustinfamily.us> - 2012-06-27 16:56 -0700
  Re: JS newbie and Array newbie Gregor Kofler <usenet@gregorkofler.com> - 2012-06-27 11:00 +0200
    Re: JS newbie and Array newbie RoLaAus <robert@theaustinfamily.us> - 2012-06-27 17:01 -0700
      Re: JS newbie and Array newbie "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2012-06-29 16:45 -0700

csiph-web