Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Will this send it into an infinite loop?

62 views
Skip to first unread message

gro...@cyberdude.com

unread,
Nov 2, 2018, 2:14:21 PM11/2/18
to
function Set() {
blah blah

let intersectionSet = new Set();

}

Will this send it into an infinite loop when the "Set" class is instantiated? If not, why not?

Evertjan.

unread,
Nov 3, 2018, 5:47:42 AM11/3/18
to
Did you test it?

If so, what was the result, and on what engine?

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

John G Harris

unread,
Nov 3, 2018, 10:37:34 AM11/3/18
to
It won't be an *infinite* loop. At best, after a billion or so
iterations your PC will run out of room for more objects and stop or
squeal or something else dramatic.

In practice, it will probably stop after fewer iterations.

John

gro...@cyberdude.com

unread,
Nov 6, 2018, 12:56:32 PM11/6/18
to
On Saturday, 3 November 2018 15:17:42 UTC+5:30, Evertjan. wrote:

>
> Did you test it?
>
> If so, what was the result, and on what engine?
>

Uhh no - actually I read suchlike code in a book I was reading, which struck me as Very Peculiar, which is why I decided to ask here straightaway....

Evertjan.

unread,
Nov 6, 2018, 5:13:10 PM11/6/18
to
Don't you think that is the wrong approach,
if and when you want to learn something about Javascript?

gro...@cyberdude.com

unread,
Nov 8, 2018, 6:02:34 AM11/8/18
to
On Wednesday, 7 November 2018 03:43:10 UTC+5:30, Evertjan. wrote:

> Don't you think that is the wrong approach,
> if and when you want to learn something about Javascript?

Uhh...some times you want some *human interaction*, steadof just...sitting there with a book and the computer, you know...? :) I don't have like, a teacher in real life teaching me this stuff....?
Whatever :)

Evertjan.

unread,
Nov 8, 2018, 6:23:23 AM11/8/18
to
Well, it sounds more like 12 year old asking his or her mother:
"Can you please tie my shoelaces"
without first trying to do it him- or herself.

That 'can' be needed to force human interaction indeed.

> Whatever :)

Rather.

Oh sorry, modern youths walk around with untied shoelaces, I am told,
and prefer to occasionally fall flat on their faces and skin their noses.
This can easily be done with Javascript too.

gro...@cyberdude.com

unread,
Nov 9, 2018, 5:37:53 AM11/9/18
to
On Thursday, 8 November 2018 16:53:23 UTC+5:30, Evertjan. wrote:

> Oh sorry, modern youths walk around with untied shoelaces, I am told,
> and prefer to occasionally fall flat on their faces and skin their noses.
> This can easily be done with Javascript too.
>

Umm...."tying my own shoelaces" wouldn't have answered the question "If not, WHY not"....

Evertjan.

unread,
Nov 9, 2018, 11:42:34 AM11/9/18
to
Perhaps their shoes have unties,
like undies are white if undyed?
or modern youths feel undied?

In general the nul-hypothesis is that something specific is NOT so,
and then "why not?" is only psychologically important.

The One Who Is Writing This

unread,
Jun 30, 2022, 2:50:48 PM6/30/22
to
No, because before it will happen, your program will stop, because your computer processor will one moment crash.




****************************************
The One Who Is Writing This
0 new messages