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


Groups > comp.lang.javascript > #25932

Re: Why: X[i] = x[i] = undefined when x[i] defined?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Why: X[i] = x[i] = undefined when x[i] defined?
Date Fri, 17 Oct 2014 21:51:40 +0200
Organization PointedEars Software (PES)
Lines 47
Message-ID <3496960.XX3CMxuZ7L@PointedEars.de> (permalink)
References <fel14a5kmcg35jimb7hq4afq4tcnvfhohv@4ax.com> <m1rf17$2te$2@dont-email.me> <95g24apb19udm64v45cehj91b6nj7uo3jb@4ax.com> <0ol24alq2cr6m3hosessv298crkhsnh7ck@4ax.com> <2394444.guKU09TTg3@PointedEars.de> <llr24al57aqodrs2585596a1ef5jd72mi9@4ax.com>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1413575501 22993 eJwNysEBwCAIA8CVsBCUcTA0+4/Q3vvguZI7EhkQZKDcpog75cb7WgWFAY7UczT/eVi9WyfWBzFLEfo= (17 Oct 2014 19:51:41 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Fri, 17 Oct 2014 19:51:41 +0000 (UTC)
User-Agent KNode/4.14.1
X-User-ID eJwNyskRwDAIBLCWWE5TDhDTfwnx6CsTh0+om6vtQ4QcaVAwM8jP7VMDttE71JH5hUHZ5y7UErVvb7IUAfgBJN4UTA==
Cancel-Lock sha1:psta38+Vv4yMrJa++w3RVcdcFao=
X-NNTP-Posting-Host eJwFwYEBgDAIA7CXGLRFzxEY/59gwtBRJ0SBy11dr+380svX4wBKC596qcBj49W0m5hE9/waQRD6
Xref csiph.com comp.lang.javascript:25932

Show key headers only | View raw


Ed Jay wrote:

> […] Thomas 'PointedEars' Lahn […] wrote:
>> What you actually have neglected is to declare “x_pos_array” and
>> “y_pos_array” variables by using the “var” keyword:
>>
>>  var x_pos_array = [];
>>  var y_pos_array = [];
>>
>> Not doing this causes your code to be more error-prone than it needs to
>> be. You might be accidentally accessing a property of the global object,
>> and your code will maybe compile, but certainly not run in ES5+ strict
>> mode.
>
> Thank you!

You are welcome.  As you did not know this, what did you mean by

>>> Neglected to declare div as an array. 

?  In the code that you posted –

>>> var div = document.createElement('div');
>>> image_holder.appendChild(div); 
>>> div.id = 'mrkr'+marker_cnt;

– “div” does not refer to an Array instance; it refers to a “div” element 
object.

>> Please provide a working contact e-mail address in the From header field,
>> see also <http://www.interhack.net/pubs/munging-harmful/>.
> 
> Remove the M and you have it.

It is not socially acceptable behavior of you to expect others to fiddle 
with the “To:” field before being able to contact you via e-mail.  (Your 
signature might not even be displayed.)

Also, please trim your quotations to the relevant minimum (this is also 
recommended in the FAQ).  Bandwidth may not be as precious as in the early 
days of Usenet, but free time still is.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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


Thread

Why: X[i] = x[i] = undefined when x[i] defined? Ed Jay <edMbj@aes-intl.com> - 2014-10-17 01:50 -0700
  Re: Why: X[i] = x[i] = undefined when x[i] defined? Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-17 16:10 +0000
    Re: Why: X[i] = x[i] = undefined when x[i] defined? Ed Jay <edMbj@aes-intl.com> - 2014-10-17 09:29 -0700
      Re: Why: X[i] = x[i] = undefined when x[i] defined? Ed Jay <edMbj@aes-intl.com> - 2014-10-17 10:52 -0700
        Re: Why: X[i] = x[i] = undefined when x[i] defined? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-17 21:29 +0200
          Re: Why: X[i] = x[i] = undefined when x[i] defined? Ed Jay <edMbj@aes-intl.com> - 2014-10-17 12:32 -0700
            Re: Why: X[i] = x[i] = undefined when x[i] defined? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-17 21:51 +0200
              Re: Why: X[i] = x[i] = undefined when x[i] defined? Ed Jay <edMbj@aes-intl.com> - 2014-10-17 13:21 -0700
              Re: Why: X[i] = x[i] = undefined when x[i] defined? Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-10-18 21:38 +0100
          Re: Why: X[i] = x[i] = undefined when x[i] defined? John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-18 10:36 +0100
      Re: Why: X[i] = x[i] = undefined when x[i] defined? Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-18 22:17 +0000
        Re: Why: X[i] = x[i] = undefined when x[i] defined? Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> - 2014-10-19 22:54 +0100

csiph-web