Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71931

console.log output is wrong for multidimensional arrays

    XMLWordPrintable

Details

    • 604e379338e7c9e17c929063148754a30077988c

    Description

      Very Simply:

      var a = [[1,2,3,4], [5,6,7,8]];
      console.log("array (raw):", a);
      

      should print the same as:

      console.log("array (string):", JSON.stringify(a));
      

      But what you get is:

      qml: array (raw): [1,2,3,4,5,6,7,8] 
      qml: array (string): [[1,2,3,4],[5,6,7,8]]}}
      

       Currently this is confusing the heck out of me.

       When I run the same code in browser or node.js:

      array (raw): [ [ 1, 2, 3, 4 ], [ 5, 6, 7, 8 ] ]
      array (string): [[1,2,3,4],[5,6,7,8]]
      

      Which I would argue is substantially correct/more correct. The only difference is white space.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            scorp1us Jason Hihn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes