properties - strange javascript property definition using polymer -


in following code xfoo object (or prototype) has actual property bar value of 5 , will have actual method foo(). kind of object notation this? not how define properties in ecmascript 5. have expected xfoo.bar object has function get() , xfoo.foo object has method value(). missing here?

var xfoo = document.registerelement('x-foo', {     prototype: object.create(htmlelement.prototype, {         bar: {             get: function () {                 return 5;             }         },         foo: {             value: function () {                 alert('foo() called');             }         }     }) });  var xfoo = new xfoo(); 

yes, guess correct:

https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/object/create#parameters

sorry, have @ least tried google javascript object.create?


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -