Accessing property of object with variable

object[propertiesArray[0]]

This will do the trick. Object attributes can be accessed like array indexes using []

Leave a Comment