why would Jquery print differently to console.log
Why would the Jquery below print differently in chrome than JSfiddle?
- function AttributeNodeClass(name, type, klass, description, controls) {
- this.name = name
- this.type = type
- this.class = klass
- this.description = description
- this.controls = controls
- this.dump = function(){
- console.log(this)
- }
- }
- function ANCList() {
- var list = []
- this.add = function (attributeNodeClass) {
- list.push(attributeNodeClass)
- return this
- }
- this.dump = function () {
- $.each(list, function (i, anc) {
- anc.dump()
- })
- return this
- }
- }
- var one = new AttributeNodeClass("this", "integer", "circle")
- var two = new AttributeNodeClass("that", "number", "line")
- var three = new AttributeNodeClass("the Other", "string", "rectangle")
- var catalog = new ANCList().add(one).add(two).add(three).dump()
- Jsfiddle Output:
-
- Chrome Output:
-
- class: "circle"
- controls: undefined
- description: undefined
- dump: function (){
- name: "this"
- type: "integer"
- __proto__: AttributeNodeClass