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


Groups > comp.lang.javascript > #39177 > unrolled thread

Re: JavaScript + DOM, type system

Started by"Evertjan." <exxjxw.hannivoort@inter.nl.net>
First post2020-11-23 15:36 +0100
Last post2020-11-23 15:36 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.javascript

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: JavaScript + DOM, type system "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-11-23 15:36 +0100

#39177 — Re: JavaScript + DOM, type system

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2020-11-23 15:36 +0100
SubjectRe: JavaScript + DOM, type system
Message-ID<XnsAC7E9ED9E4143eejj99@194.109.6.166>
ram@zedat.fu-berlin.de (Stefan Ram) wrote on 22 Nov 2020 in 
comp.lang.javascript:

> PS: I only now see (skimming through my notes from a recent course)
>   that participants of my course lost all inhibitions and really wrote
>   code like
> 
> ++a.textContent 

<div>123</div>

let a = document.querySelector('div');
++a.textContent;
++a.innerHTML; 

and

const b = document.querySelector('div');
++b.textContent;
++b.innerHTML;

// 127 / So both are fine.


>   , and it "worked" in the Browser, incrementing a numeral on the web
>   page by one. I was flabbergasted, but not able to immediately come
>   up with a convincing reason why they should not do this.

Next thing they'll do is:

const c = 7;
let d = c++;
// Uncaught TypeError: Assignment to constant variable.

And they will be the wiser.

btw Google: A 'constant variable' is nonsense.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web