experchange > javascript

John G Harris (10-08-18, 08:43 PM)
On Sun, 7 Oct 2018 09:57:51 -0700 (PDT), Jonas Thörnvall
<jonas.thornvall> wrote:

>Den fredag 5 oktober 2018 kl. 19:17:22 UTC+2 skrev John G Harris:
>LoL that is no insert into a filled array that is an update... see below


It is an insert. The expression new Array() creates an array with no
elements. Putting an element into an empty array is an insert action.

<snip>
>Compare with something that is "symantically coherent", and that a normal brain would come up with.
>a[3].delete(5).insert("splish,"splosh");
>I mean anyone who knows what an array is will immediately see what is going on. <snip>


No, there's a better way :
a.splice( start = 3, removeCnt = 5, insert = ["splish", "splosh"] );

Some programming languages let you do it this way. The closest to that
in ECMAScript is to have the function require you to supply an object
with its properties :
a.splice( {start:3, removeCnt:5, insert:["splish", "splosh"]} );

A problem with your suggestion is that there is no way to return a new
array containing the removed entries. Some people will want that
array.

John
John G Harris (10-09-18, 11:38 AM)
On Sun, 7 Oct 2018 15:15:42 +0200, Thomas 'PointedEars' Lahn
<PointedEars> wrote:

></killfile>
>John G Harris wrote:
>Idiot.


A well reasoned and concise argument.

Thomas screams at people who use two lines to say which article is
being quoted. Then Thomas uses three lines.

Idiot is not really the right word. Hypocrite is the word.

> ^ ^^^^^
> ^^^^^^^^^^^^^^ ^^^^^^^^^
>Idiot.


This year is the nineth year of the second decade of the first
centuary of the third millenium. So Thomas insists that you write
3129 instead of 2018.
Idiot indeed.

Thomas has forgotten that 'first' has two meanings. It can imply the
number 1, or it can say the foremost, the thing at the front of the
queue, the top football club in the league, regardless of whether it
is numbered 0, 1, or 77.

John
dr.s.lartius (10-09-18, 05:27 PM)
On Tuesday, October 9, 2018 at 10:38:25 AM UTC+1, John G Harris wrote:

> This year is the nineth year of the second decade of the first
> centuary of the third millenium.


Some, including myself and Chrome's spell-checker, would prefer :-

"This year is the ninth year of the second decade of the first
century of the third millennium." - but, except for astronomers,
it is the eighth year. A.D. 0 is noteworthy for non-existence.

ASIDE : In the evidently-misnamed product "Windows", is it possible
for an ordinary programmer to make an editable window (not
necessarily a browser window) or part-window, with DOM
Textarea being an example, properly transparent, so that
one can compose text overlaid on whatever would appear in
that region if the editing application was minimised or
closed?

[ Misnamed, because one normally is able to see _through_
a _real_ glass window. ]
John G Harris (10-09-18, 08:12 PM)
On Tue, 9 Oct 2018 08:27:56 -0700 (PDT), dr.s.lartius wrote:

>On Tuesday, October 9, 2018 at 10:38:25 AM UTC+1, John G Harris wrote:
>Some, including myself and Chrome's spell-checker, would prefer :-
> "This year is the ninth year of the second decade of the first
> century of the third millennium." - but, except for astronomers,
> it is the eighth year.


I relied on the spelling checker, which for some reason didn't hiccup
in that article. Anyway, I'm not too worried about spelling when
replying to Thomas.

> A.D. 0 is noteworthy for non-existence. <snip>


I'm with the astronomers.

Incidentally, how does one provide irrefutable proof that 0 AD did not
exist? We know that AD/BC was invented by people who didn't think 0
was a number, and that it can't be written in Latin. So the year
before +1 could only be -1, except that they didn't know about
negative numbers either. But knowledge has moved on since.

It must have been awkward back then when a child's 1st birthday
happened in 1 AD. How old were they at birth? Oh, 1 Before First
Birthday.

HTH
John

Similar Threads