Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

expected map as JsObject

by bigup401 (Pilgrim)
on May 07, 2017 at 16:14 UTC ( [id://1189743]=perlquestion: print w/replies, xml ) Need Help??

bigup401 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: expected map as JsObject
by afoken (Chancellor) on May 07, 2017 at 17:31 UTC

    Let me repeat, as it seems you need to be told that over and over again:

    Don't open new threads for the same problem!

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      I agree with afoken here.

      Do yourself a favour and adhere to well-advised advice already given. If you don't, you may be ignored or slighted by those who can help.

        ok i understand

Re: expected map as JsObject
by stevieb (Canon) on May 07, 2017 at 16:23 UTC

    Huh? Is there a question?

    Also, a Perl hash (and subsequently a JSON object) can only contain *unique* keys.

      Actually, a JSON object doesn't have to contain unique keys. But the JSON spec doesn't define what implementations should do with objects that have a repeated key. Some will throw an error; some will accept the first value; some will accept the last value; some will do something else interesting.

      RFC7159 recommends that keys are unique, but doesn't require it. ECMA-404 says nothing at all about uniqueness of keys.

      (The ECMA-262 spec defines how Javascript implementations of JSON.parse must parse JSON, and says to use the last value. But this doesn't say how other languages should implement it, nor how Javascript libraries should implement it if they're not called using the function name JSON.parse.

      I once wrote a JSON parser that supports repeated keys in a useful way.

        thanks tobyink ur feedback is really helpful

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1189743]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-26 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found