Super quick note on something that has been bugging me lately. If you’re using dot notation to access Javascript properties, you can’t have a property name with dashes in it (e.g. image.attributes.media_details.sizes.plugin-name-headshot
). Instead you need to use bracket notation with quotation marks. So in replace the example above with image.attributes.media_details.sizes['plugin-name-headshot']
.
Dashes in Javascript Objects
by
Tags:
Leave a Reply