Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Justin Meyer
    @justinbmeyer
    Hello, we are going to get started soon
    Alexis Abril
    @alexisabril
    and we’re live!
    James Atherton
    @James0x57
    This message was deleted
    metaKey on windows is the windows key
    a live jsbin stream of justin’s code
    James Atherton
    @James0x57
    I can see it now, deleted the message, sorry - might have just been on my end
    Cory Robinson
    @crobinson42
    Can anyone explain why this returns an empty object "JSON.stringify(navigator)”? I don’t have any errors showing just “{}"
    Justin Meyer
    @justinbmeyer
    Why would you do that?
    @crobinson42
    navigator references an object
    Cory Robinson
    @crobinson42
    Writing a simple module that stores error messages in local storage so when a user submits a bug I can see their error storage
    Justin Meyer
    @justinbmeyer
    you can only pass "simple objects"
    to JSON.stringify
    Cory Robinson
    @crobinson42
    What’s the difference between a simple object and…?
    JSON.stringify(location) works..?
    Justin Meyer
    @justinbmeyer
    a complex proto chain
    Cory Robinson
    @crobinson42
    any references I can read on this?
    Justin Meyer
    @justinbmeyer
    I'm surprised location works
    does navigator have any enumerable properties?
    actually, it doesn't seem to
    this is the problem
    Cory Robinson
    @crobinson42
    Object.keys(navigator)
    []
    nope.
    Object.keys(location)
    ["replace", "assign", "ancestorOrigins", "origin", "hash", "search", "pathname", "port", "hostname", "host", "protocol", "href", "reload"]
    Aha!!
    Justin Meyer
    @justinbmeyer
    getOwnPropertyDescriptor
    might be useful
    oh, nm
    hmmm
    I was hoping there's a way to get non-enumerable properties
    Cory Robinson
    @crobinson42
    You’re the man! Thanks Justin. I appreciate your time on the videos you’re doing Wednesdays…I’ve been watching when I can.
    Justin Meyer
    @justinbmeyer
    off an object
    Object.getOwnPropertyNames(navigator)
    []
    yarg!
    The object whose enumerable and non-enumerable own properties are to be returned.
    I don't get why that is empty then
    asking the internet
    Cory Robinson
    @crobinson42
    right on
    Justin Meyer
    @justinbmeyer
    so, you can do a for( prop in navigator)
    So, if you are using jQuery, you can probably do something like:
    JSON.stringify( $.extend({}, navigator) )
    Cory Robinson
    @crobinson42
    Any explanation on why that works but not getOwnPropertyNames()
    Justin Meyer
    @justinbmeyer
    my best guess is that this is a bug
    that navigator is a host object
    Cory Robinson
    @crobinson42
    ahh..