0

I got this object:

Object {_supports_ajax: "1", _supports_bundle: "1", css_classes: Array[2], id:     "_data_afbeelding", type: "image"…}
_supports_ajax: "1"
_supports_bundle: "1"
_supports_repeatable: ""
admin_column_filter: ""
admin_column_sortable: ""
after: ""
after_id: ""
ajax: ""
args: Object
    preview_size : Array[2]
        0: 200
        1: 200
        length: 2
        __proto__: Array[0]
    __proto__: Object
css_classes: Array[2]
data_attributes: Array[0]
default_value: ""
description: "Just a little description"
explanation: "This is just a explanation explaining the field above!"
id: "_data_afbeelding"
in_bundle: ""
label: "Afbeelding"
limit: null
meta_type: "post"
name: "afbeelding"
options: Array[0]
parent: "data"
pre: ""
pre_id: ""
repeatable: ""
required: ""
show_admin_column: ""
type: "image"
underscore: "1"
__proto__: Object
}

When I log args (console.log(Object.args)), then I just get an object with preview_size in it. But when I log Object.args.preview_size I get undefined.

Really strange I think, or am I doing something wrong?

0

1 Answer 1

2

There's a space between preview_size and :, so you need to do:

console.log(Object.args["preview_size "])

I suggest you find the code that creates the object, and fix whatever is causing it to add a space there. I doubt it's by design.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.