Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: retired developer Newsgroups: comp.lang.javascript Subject: JSON, definitions, standards - things I do not understand Date: Tue, 4 Aug 2020 03:33:46 +0200 Lines: 100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net ffbwzXUsXZ6myohxRUsaAQ+5jLEFyYIC7isioxrC7aFx2L0J4U Cancel-Lock: sha1:528zeD80/ANeb66xwbIMhEQ2s6A= X-Mozilla-News-Host: news://news.individual.de:119 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Content-Language: en-US Xref: csiph.com comp.lang.javascript:38632 Hello, I hope this is the right place for my questions, if not, please redirect me to the proper group. Thanks. Beside JavaScript, I use another programing language too where JSON is supported. During a data import (data in JSON format) I found a typo in my imported data, but the import was without any error message. What the heck is that, I thought, and started some digging... Here are the results, and I'm stumped. The html file (see below) was opened with Google Chrome. The output (see below too) looks a little bit buggy, but I think, the staff at Google will know, what they do, so there must be some kind of explanation for this output. Is there someone here who can enlighten me? Thank you, Julius --- the html-file --------------------------
--- end-of-html-file -------------------------------------- --- the-output -------------------------- [ 11,, null] --> Unexpected token , in JSON at position 5 [11,null,null] --> empty field (,,) is parsed! array-size: 3 --> nonexistent (undefined) items are counted 0 number 1 undefined 2 object --> FOR loop is executed 3 times 0 number 2 object --> The loop is executed 2 times! [11,null,null] --> [11,undefined,null] Stringify vs. content. Which one is correct? --- end-of-output ------------------------------------- -- An old Windows has old security holes. A new Windows has new security holes. Another OS has other security holes. For safety you must care yourself.