Where communities thrive
Join over
1.5M+ people
Join over
100K+ communities
Free
without limits
Create
your own community
Explore more communities
bitovi/js-training
People
Repo info
Activity
Matthew Phillips
@matthewp
No
Julian
@pYr0x
also in es6?
Matthew Phillips
@matthewp
Nope, just a single extend as far as I'm aware.
Julian
@pYr0x
thats a big drawback
is think... often i need a multiple inheritance
Matthew Phillips
@matthewp
Maybe coming from php, but I don't miss it in JavaScript personally
Like I said mixins give you the same thing just not with instanceof
Julian
@pYr0x
and how can i check if the object is an instance of an other?
without instanceof
Matthew Phillips
@matthewp
Check if it looks like that object
Like a NodeList is not an Array, but it has a length property so that's good enough for the array methods.
Justin Meyer
@justinbmeyer
Hello, we are going to get started soon
My jsbin:
http://jsbin.com/zocoperihe
Alexis Abril
@alexisabril
and we’re live!
James Atherton
@James0x57
This message was deleted
metaKey on windows is the windows key
Alexis Abril
@alexisabril
http://jsbin.com/worocajaju/latest/watch?html,css,js
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
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
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
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames
Object.getOwnPropertyNames(navigator)
[]
yarg!
The object whose enumerable and non-enumerable own properties are to be returned.