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


Groups > comp.lang.javascript > #37957

Re: object giving errors

Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail
NNTP-Posting-Date Thu, 12 Dec 2019 03:39:02 -0600
Subject Re: object giving errors
Newsgroups comp.lang.javascript
References <h5Cdnb0TscbyZWzAnZ2dnUU7-f3NnZ2d@westnet.com.au> <4494564.GXAFRqVoOG@PointedEars.de>
From Andrew Poulos <ap_prog@hotmail.com>
Date Thu, 12 Dec 2019 20:38:52 +1100
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0
MIME-Version 1.0
In-Reply-To <4494564.GXAFRqVoOG@PointedEars.de>
Content-Type text/plain; charset=utf-8; format=flowed
Content-Language en-AU
Content-Transfer-Encoding 8bit
Message-ID <7aidncxN1tcrl2_AnZ2dnUU7-R0AAAAA@westnet.com.au> (permalink)
Lines 45
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 60.241.30.10
X-Trace sv3-g5g6ZJZZeQrRyq1VUvOe5VG+q0lo/qukWpkRrwc5v/nW3DfZ8851kVNW/w9Sb9ANStRqy76BAx7Y3FC!9xTCifR1oBh4CS8/OzKkmtfnxBa4A50MzyR0oi9sWdFGUgYLzzQFPVTxsuIa/ubdCs/ptSKGrGTG!SuvEWGskAoknwP/yobw=
X-Complaints-To abuse@westnet.com.au
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2650
Xref csiph.com comp.lang.javascript:37957

Show key headers only | View raw


On 12/12/2019 8:11 pm, Thomas 'PointedEars' Lahn wrote:
> Andrew Poulos wrote:
> 
>> Why is it that when I do this
>>
>> function pos() {
>>     return { "top": 10, "left": l20 };
>> }
>>
>> or this
>>
>> function pos() {
>>     let o = { "top": 10, "left": l20 };
>>     return o;
>> }
>>
>> I get "Uncaught ReferenceError: l20 is not defined".
>>
>> But when I do it like this
>>
>> function pos() {
>>     let o = {};
>>     o.top = 10;
>>     o.left = 120;
>>     return o;
>> }
>>
>> I get no errors?
> 
> The first code snippet contains a reference to the variable with identifier
> (in words) “‘U+006C Latin Small Letter L’, followed by ‘U+0032 Digit Two’,
> followed by ‘U+0030 Digit Zero’”; the second one contains the decimal
> numeric literal (in words) “one hundred twenty” (i.e. “U+0031 Digit One”,
> followed by “U+0032 Digit Two”, followed by “U+0030 Digit Zero”).
> 
> Using an *unambiguous* *monospace* font like “DejaVu Sans Mono” (free
> software), “Bitstream Vera Mono” (Open Source) or “Consolas” (proprietary;
> de Groot/Microsoft), and an editor supporting code completion, like
> Atom(.io), and a code checker like ESLint(.org), for software development,
> helps to avoid such problems.

You guys saw the issue straight-away but I was stumped. I'll update my 
fonts accordingly.

Andrew Poulos

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


Thread

object giving errors Andrew Poulos <ap_prog@hotmail.com> - 2019-12-12 19:20 +1100
  Re: object giving errors Julio Di Egidio <julio@diegidio.name> - 2019-12-12 00:31 -0800
    Re: object giving errors Andrew Poulos <ap_prog@hotmail.com> - 2019-12-12 20:36 +1100
  Re: object giving errors Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-12-12 10:11 +0100
    Re: object giving errors Andrew Poulos <ap_prog@hotmail.com> - 2019-12-12 20:38 +1100
      Re: object giving errors Julio Di Egidio <julio@diegidio.name> - 2019-12-12 02:21 -0800
  Re: object giving errors "R.Wieser" <address@not.available> - 2019-12-14 17:24 +0100

csiph-web