Skip to content

Instantly share code, notes, and snippets.

@MgenGlder
Created June 21, 2017 17:56
Show Gist options
  • Save MgenGlder/3f5bbfc3a2200f19f24b01a0be084de8 to your computer and use it in GitHub Desktop.
Save MgenGlder/3f5bbfc3a2200f19f24b01a0be084de8 to your computer and use it in GitHub Desktop.
Check if an attribute belongs to an object before accessing it.
(key in inventoryRecord.custom) && inventoryRecord.custom[key] >= qtySelected;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment