Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9001829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:29:18+00:00 2026-06-16T00:29:18+00:00

I obtained the following trace from Chrome developer tool’s console: > a = [1]

  • 0

I obtained the following trace from Chrome developer tool’s console:

> a = [1]
[1]
> b = [2, a]
[2, Array[1]]
> a.push(b)
2
> a.toString()
"1,2,"

It seems the toString() intelligently skipped the recursive part of the object graph. Is this a standard behavior documented somewhere?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:29:18+00:00Added an answer on June 16, 2026 at 12:29 am

    [ECMA-262: 15.4.4.2]: Array.prototype.toString ( )

    When the toString method is called, the following steps are taken:

    1. Let array be the result of calling ToObject on the this value.
    2. Let func be the result of calling the [[Get]] internal method of array with argument "join".
    3. If IsCallable(func) is false, then let func be the standard built-in method Object.prototype.toString (15.2.4.2).
    4. Return the result of calling the [[Call]] internal method of func providing array as the this value and an empty arguments list.

    NOTE The toString function is intentionally generic; it does not require that its this value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method. Whether the toString function can be applied successfully to a host object is implementation-dependent.

    All of this basically means that the result is a call to Array.prototype.join(), which is defined in 15.4.4.5 and doesn’t mandate any recursion detection:

    [ECMA-262: 15.4.4.5]: Array.prototype.join (separator)

    The elements of the array are converted to Strings, and these Strings are then concatenated, separated by occurrences of the separator. If no separator is provided, a single comma is used as the separator.

    The join method takes one argument, separator, and performs the following steps:

    1. Let O be the result of calling ToObject passing the this value as the argument.
    2. Let lenVal be the result of calling the [[Get]] internal method of O with argument "length".
    3. Let len be ToUint32(lenVal).
    4. If separator is undefined, let separator be the single-character String ",".
    5. Let sep be ToString(separator).
    6. If len is zero, return the empty String.
    7. Let element0 be the result of calling the [[Get]] internal method of O with argument "0".
    8. If element0 is undefined or null, let R be the empty String; otherwise, Let R be ToString(element0).
    9. Let k be 1.
    10. Repeat, while k < len
      1. Let S be the String value produced by concatenating R and sep.
      2. Let element be the result of calling the [[Get]] internal method of O with argument ToString(k).
      3. If element is undefined or null, Let next be the empty String; otherwise, let next be ToString(element).
      4. Let R be a String value produced by concatenating S and next.
      5. Increase k by 1.
    11. Return R.

    The length property of the join method is 1.

    NOTE The join function is intentionally generic; it does not require that its this value be an Array object. Therefore, it can be transferred to other kinds of objects for use as a method. Whether the join function can be applied successfully to a host object is implementation-dependent.

    So, is it a standard-guaranteed behaviour? No.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following code, a struct is obtained from an array and from a
This has to be obtained from a remote machine. The following query works not
I've obtained a survival plot from the following code: s = Surv(outcome.[,1], outcome.[,2]) survplot=
I am attempting to parse the following date strings obtained from email headers: from
I'm using Visual Studion 2010, and given the following example function obtained from WinGDI.h:
So I obtained contact data from Google in the form of the following jumble
I have the following code, obtained from http://jakearchibald.com/scratch/alphavid/ $(#video).append('<video id=movie style=display:none autobuffer><source id=srcMp4 src=https://host-away-from-host.com/file.mp4
I have a Recordset obtained by the following query: SELECT DISTINCT [Number] FROM NUMBERS
I use the following t-sql code for assign to variable a value obtained from
I want replicate the effect obtained by the following CSS code: background: white url(./img/background.png)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.